Computing.Net > Forums > Disk Operating System > Please help me out.

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.

Please help me out.

Reply to Message Icon

Name: gsandan
Date: August 21, 2003 at 20:19:20 Pacific
OS: XP Pro w/SP1
CPU/Ram: P3/512 MB
Comment:

How can i mass rename files in a batch.

Example:
*.* (everything in the folder is renamed)
$$$$$1.lol (everything in the folder is renamed to this with a counter somewhere to prevent duplication errors)

So "file.txt" is renamed to "$$$$$1.lol","file2.txt" is renamed to "$$$$$2.lol", "file3.txt" is renamed to "$$$$$3.lol" and, "file4.txt" is renamed to "$$$$$4.lol"...

How can I do this?



Sponsored Link
Ads by Google

Response Number 1
Name: Adrian S
Date: August 22, 2003 at 04:06:40 Pacific
Reply:

Are you talking about using the DOS command 'rename' or writing a program to do this for you.
RENAME
IF all the filenames are the same length and are already numbered ie (file1.txt file2.txt file3.txt) or (abcd1.txt defg2.txt ghij3.txt) you can use use the command and syntax
rename *?.* name?.lol or
rename *?.* name?.lol

The first 4 characters will be replace with n, a, m, e, and the fifth character (the number) will be retained by the ?

file1.txt becomes name1.lol file2.txt becomes name2.lol abcd3.txt become name3.lol
Luckily rename will not allow a second file to overwrite a previously renamed file thus file1.txt and abcd1.txt both exist but abcd1.txt cannot be renamed as name1.lol because file1.txt already is renamed that.

If the names have double digits you want to save (old11.txt old12.txt you need to go *?? to retain the last two characters in the new name.
rename *??.txt new??.lol
The number of characters must be the same though in the old name and new name. If you have file names like abc.txt and asdf4.xyz and you want to rename them all to newname1.lol then newname2.lol no such luck that I am aware of, but then its been a long time since Iused dos regularly.


0

Response Number 2
Name: Brian HANLON
Date: August 23, 2003 at 09:42:43 Pacific
Reply:

Have a look at:
LMOD
Versatile line/list modification tool to generate lists of commands, set variables to anything extracted from (DOS) output, and more.. Win NT/2000 compatible.
DEC 2002

At URL: http://home.mnet-online.de/horst.muc/

This gem will enable you to take a
Dir *.* /b>dlist.txt
type of list, and pipe it through LMOD to produce a BATchfile which could rename as you require.
LMOD provides some powerful control over which parts of which words in the input file are used, so a bit of a play with LMOD should have you up and away.

Baldy.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Full screen dos?? DOS and WINXP



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: Please help me out.

Someone Help me Please www.computing.net/answers/dos/someone-help-me-please/9884.html

Please help me with CMOS& DOS www.computing.net/answers/dos/please-help-me-with-cmosamp-dos-/1111.html

Please help me....Where can I download the MEMMAKER.EXE file ? www.computing.net/answers/dos/please-help-mewhere-can-i-download-the-memmakerexe-file-/1666.html