Batch to edit contents of .txt file

August 26, 2009 at 09:01:24
Specs: Windows XP
Hi,

I have run the command
dir *.iso > games.txt /B to compile a list of all .iso game files in a specific folder. Is there a simple way for the resulting output to lose the .iso tag? For example the games.txt file results show game1.iso, game2.iso and would like just game1, game2 etc. Bit of noob with this so any help would be great.

Regards

Rizla


See More: Batch to edit contents of .txt file

Report •


#1
August 26, 2009 at 18:02:01
<untested>


for /f "delims=" %%a in ('dir /b *.iso') do echo %%~na


Report •

#2
August 26, 2009 at 21:37:43
Hi,

I've now got this:

cd "F:\SABnzbd Downloads\Complete\Games\Sorting\"
dir *.iso > games.txt /B
for /f "delims=" %%a in ('dir /b *.iso') do echo %%~na
EXIT

But it's the same in the games.txt file;
game1.iso
game2.iso etc
Have done something wrong?

Regards

Rizla


Report •

#3
August 26, 2009 at 21:41:01
That command was supposted to replace the other command:

cd "F:\SABnzbd Downloads\Complete\Games\Sorting\"
copy nul games.txt
for /f "delims=" %%a in ('dir /b *.iso') do >>games.txt echo %%~na


Report •

Related Solutions

#4
August 27, 2009 at 09:35:31
Thanks a lot that's exactly what i needed.

Cheers.

Rizla


Report •


Ask Question