Computing.Net > Forums > Disk Operating System > increment filename

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.

increment filename

Reply to Message Icon

Name: mondial
Date: May 8, 2007 at 12:56:01 Pacific
OS: windows 95
CPU/Ram: 20 mb
Product: ibm thinkpad
Comment:

Hi. Would like to know how to increment a
filename. ie. file.txt to file01.txt, file02.txt, file03.txt
etc. It's the same file with different names. Thanks.



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: May 8, 2007 at 13:56:02 Pacific
Reply:

Do you want to make copies or rename or what?


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

M2



0

Response Number 2
Name: mondial
Date: May 9, 2007 at 07:34:17 Pacific
Reply:

I suppose rename will destroy, but I need to keep
all copies, so copy it is. Thanks.


0

Response Number 3
Name: Mechanix2Go
Date: May 9, 2007 at 23:44:50 Pacific
Reply:

for %%N in (01 02 03) do copy file.txt file%%N.txt


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

M2



0

Response Number 4
Name: mondial
Date: May 10, 2007 at 09:19:49 Pacific
Reply:

Thanks, looks easy now. Is this the only way even
if you need to make ~70 copies?


0

Response Number 5
Name: mondial
Date: May 10, 2007 at 11:11:06 Pacific
Reply:

I figured it out. /l
Thanks.

M


0

Related Posts

See More



Response Number 6
Name: matta
Date: May 25, 2007 at 06:35:50 Pacific
Reply:


I would like to incrment the file extension at different times. When the file is created at 1:30 as <filename>.txt it could be renamed as <filename>.001. Then, when the file is created at 2:00 as <filename>.txt again it could be renamed as <filename>.002, etc...
Any ideas?


0

Response Number 7
Name: Mechanix2Go
Date: May 25, 2007 at 13:16:01 Pacific
Reply:

You need a new thread.


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

M2



0

Response Number 8
Name: Fen_Li
Date: June 29, 2007 at 14:32:35 Pacific
Reply:

@mondial

70~copies :
for /l %%a (1,1,70) do copy "file.txt" "file%%~a.txt"

"still newbie kid"


0

Response Number 9
Name: Mechanix2Go
Date: June 30, 2007 at 02:09:06 Pacific
Reply:

There is no for /l in DOS.


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

M2



0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: increment filename

invalid long filename www.computing.net/answers/dos/invalid-long-filename/13384.html

Appending Datestamp to Filename www.computing.net/answers/dos/appending-datestamp-to-filename/13097.html

remove long filename www.computing.net/answers/dos/remove-long-filename/14753.html