Computing.Net > Forums > Programming > Batch to edit contents of .txt file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch to edit contents of .txt file

Reply to Message Icon

Name: R1ZLa
Date: August 26, 2009 at 09:01:24 Pacific
OS: Windows XP
Subcategory: Batch
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: Judago
Date: August 26, 2009 at 18:02:01 Pacific
Reply:

<untested>


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


0

Response Number 2
Name: R1ZLa
Date: August 26, 2009 at 21:37:43 Pacific
Reply:

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


0

Response Number 3
Name: Judago
Date: August 26, 2009 at 21:41:01 Pacific
Reply:

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


0

Response Number 4
Name: R1ZLa
Date: August 27, 2009 at 09:35:31 Pacific
Reply:

Thanks a lot that's exactly what i needed.

Cheers.

Rizla


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Moving columns in a txt f... merge / combine / append ...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch to edit contents of .txt file

Add FileName to a series of TXT files www.computing.net/answers/programming/add-filename-to-a-series-of-txt-files-/19981.html

batch file to clear txt file www.computing.net/answers/programming/batch-file-to-clear-txt-file/12925.html

batch to edit a txt file www.computing.net/answers/programming/batch-to-edit-a-txt-file/15327.html