Computing.Net > Forums > Programming > Adding .1 to file names thru Batch

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.

Adding .1 to file names thru Batch

Reply to Message Icon

Name: screamoon
Date: July 20, 2006 at 05:21:17 Pacific
OS: XP Pro. SP2
CPU/Ram: 1gb
Product: Xenon
Comment:

SUppose I have a text file with contents as :
1)000000fd9ac1873d-0000-0509-94050a25
2)000000fd57acc331-0000-0ed6-94050a25
3)00000102ac2a457b-0000-045d-94050a25
4)00000104a5b5af66-0000-0431-94050a25


I want to add .1 at the end of every file name. How do I do this ?

Please Help

Thanking you
scream

screamoon



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: July 20, 2006 at 05:44:08 Pacific
Reply:

If the 1) is just indicating a line number and the actual line is:

000000fd9ac1873d-0000-0509-94050a25

then you can:

for /f %%L in (somefile) do (
>> newfile echo %%L1 )



=====================================
If at first you don't succeed, you're about average.

M2



0

Response Number 2
Name: Mechanix2Go
Date: July 20, 2006 at 05:50:13 Pacific
Reply:

oops

I should read more carefully.

::==
@echo off

for /f %%L in (somefile) do (
>> newfile echo %%L.1 )
::== DONE


=====================================
If at first you don't succeed, you're about average.

M2



0

Response Number 3
Name: screamoon
Date: July 20, 2006 at 06:14:52 Pacific
Reply:

Thank you very much.......lol I guess you just proved your own statement.

"If at first you don't succeed, you're about average." <== hahaaha you didnt read it correctly for the first time..... ;-)

Thank you for the help though.

screamoon


0

Response Number 4
Name: Shr0Om
Date: July 20, 2006 at 08:12:49 Pacific
Reply:

If its all .txt files you could also do:

ren *.txt *.1


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Append Multiple .txt fil... Recursion with Folder Hei...



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: Adding .1 to file names thru Batch

DOS: Adding date to file name. www.computing.net/answers/programming/dos-adding-date-to-file-name/11491.html

Batch file adding text to file also www.computing.net/answers/programming/batch-file-adding-text-to-file-also/16756.html

Batch file: Adding to file names www.computing.net/answers/programming/batch-file-adding-to-file-names/9098.html