Computing.Net > Forums > Programming > Create a batch file to rename text

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.

Create a batch file to rename text

Reply to Message Icon

Name: Floyd4us
Date: November 22, 2006 at 05:15:23 Pacific
OS: XP
CPU/Ram: Pen4/1GB
Product: Dell
Comment:

I would like to create a batch file that will add an additional 1 to the front of an existing 8 digit text file,i.e...

11062169.txt-->111062169.txt
09524659.txt-->109524659.txt
65409995.txt-->165409995.txt

There are hundreds of files this will be used on and the digit added will always be a 1.

Anyone have any ideas?

Floyd4us



Sponsored Link
Ads by Google

Response Number 1
Name: RTAdams89
Date: November 22, 2006 at 05:50:20 Pacific
Reply:

Well if you don't mind using a program, try Bulk Rename Utility (just search Google for that, it's the first result).

-Ryan Adams
http://members.cox.net/rtadams89/


0

Response Number 2
Name: IVO
Date: November 22, 2006 at 06:05:55 Pacific
Reply:

You don't need a batch script, just type at prompt in the directory where files are stored

for /f %i in ('dir /b /a-d *.txt') do @ren %i 1%i

and you are done.


0

Response Number 3
Name: Floyd4us
Date: November 22, 2006 at 07:46:11 Pacific
Reply:

I tried to run the above line in the dos command promt and it tells me:

/f% was unexpected at this time

I am running in the right directory.

Floyd4us


0

Response Number 4
Name: Floyd4us
Date: November 22, 2006 at 07:51:02 Pacific
Reply:

Nevemind...I missed the space between the f and the %!!! Thanks it worked GREAT!

Floyd4us


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







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: Create a batch file to rename text

Batch file to rename file www.computing.net/answers/programming/batch-file-to-rename-file/13945.html

Creat a Batch file to zip files www.computing.net/answers/programming/creat-a-batch-file-to-zip-files-/17644.html

Create a batch file to edit text file www.computing.net/answers/programming/create-a-batch-file-to-edit-text-file/19035.html