Click to See Complete Forum and Search --> : Batch script for renaming multiple files


frag79
11-18-2003, 10:44 PM
I downloaded a very handy script for renaming multiple files. It renames all the files in a directory to files with the same name and a numerical index. For example (from the readme file), it can rename files like this:

103-0308_IMG.JPG
103-0309_IMG.JPG
103-0310_IMG.JPG
103-0316_IMG.JPG
103-0327_IMG.JPG
103-0329_IMG.JPG
103-0338_IMG.JPG

to this:

hawaii_vacation_001.JPG
hawaii_vacation_002.JPG
hawaii_vacation_003.JPG
hawaii_vacation_004.JPG
hawaii_vacation_005.JPG
hawaii_vacation_006.JPG
hawaii_vacation_007.JPG

My problem is that sometimes it adds the letter a after the number, like this:

hawaii_vacation_001.JPG
hawaii_vacation_002.JPG
hawaii_vacation_003a.JPG
hawaii_vacation_004.JPG
hawaii_vacation_005.JPG
hawaii_vacation_006a.JPG
hawaii_vacation_007.JPG

It seems to be random, and not being very familiar with the script I can't seem to find out what the problem is. Sometimes it also makes the extension of the file uppercase or lowercase...this also seems to be random.

The script is available here http://www.xscd.com/pub/mvb/

If anyone could help me figure it out it would be appreciated.

bryan.6
11-20-2003, 01:09 AM
i'm not at a proper computer to download and examine the script, however i can give you my observations about the extensions.

it appears (from the screenshot) that if a file already has a .JPG extension (capitalized) then the script does not lowercase it, but if a file doesn't have an extension, then .jpg (lowercase) is appended to it, as well as if it has a .jpg extension, it remains lowercase. that seems to be the rational reason to me.

ex:
...
IMG_031.JPG -> misc_pics2.JPG //These two already have uppercase, so not changed
IMG_045.JPG -> misc_pics3.JPG
...
file_with_no_extension -> misc_pics5.jpg //no extension, so lowercase .jpg appended