Welcome to WebmasterWorld Guest from 188.8.131.52
Forum Moderators: phranque
546-845.jpg = black-polka-dot-swim-suit.jpg
996-221.jpg = yellow-string-bikini.jpg
Using excel, I have a list of what the images are now named and another column of what I need them to be. Since I have over 15000 images changing the actual file names one at a time would take forever and I am on a deadline. I have found software that will batch rename file extensions, or rename all by dates etc. I have been unable to find anything what will change file names using data from lists and then change the ACTUAL corresponding image names. Is there any program or way that you know of that I can avoid doing this manually? Any help would be GREATLY appreciated
($old,$new) = split(/\t/, $_);
$result = rename($old, $new);
if ($result == 0)
print "Unable to rename [$old] to [$new]\n";
print "Renamed $old to $new\n";
kelleybelly, are you trying to rename the files on your own computer or on the host? If on your own computer, here's what you can do (assuming you got Windows):
- Arrange your Excel worksheet so that it has three columns: the first column has the word "rename" (without the quotes) on all rows, the second column has the original file name, the third has the new file name.
- Save this as a csv file in the directory with your image files.
- Edit the csv file with notepad or your favorite text editor and replace all commas by spaces.
- Change the files's extension to .bat and voila, you have a batch command file to rename all your files.
Before you run the file, make sure you backup everything and also do a small test on a few image files copied to a separate directory. All set? Now run your .bat file and all files should be renamed. You may want to pipe the output to "more" or a log file so you can keep an eye out for errors.
If you want to rename the files on the host, Matt Probert's solution is a good one, it's in PHP. You can do something similar with Perl or FTP scripts. They all start out with exporting your Excel worksheet to a csv file. If you don't feel comfortable doing this yourself, post an ad in craigslist or equivalent explaining what you need to be done. It should be a 1-2 hour job. Stay away from people who tell you it only takes ten minutes, they won't be very cautious and may lose some of your data with carelessness.
Hope this helps.
BTW if you're on Windows, you should get irfanview anyway. It's a great tool for image editing. :)
Yeah i first thought of irfanview as well for this but, correct me if i'm wrong, irfanview's batch rename works well on patterns but not one-to-one mappings like mentioned in the OP.
Nope... I was wrong...
Note to self: READ the OP
IrfanView is great, but it doesn't do everything... yet
However, via the Slideshow, you can 'export' file names into a .txt file... quite useful... especially with the following
I have found (and tested) a superb and very small (830kB),fast AND free download (for Windoze) from bulkrenameutility in the UK - google will find it for you
Under the File menu, it has an Import Rename-Pairs option
Create a .txt file with one line per file with file names (with extensions) separated by a pipe (¦) and no spaces, e.g.
I tried it on a folder with 160 images with various file extensions, .g.
It worked perfectly and took less than 0.5 seconds!
And... there is a forum: [bulkrenameutility.co.uk...]
In addition to Matt Probert's script . . . a few notes . . . .
Since you're moving anyway, I would seriously consider adding a function that drops these 15K images into subdirectories, that is, "folders" named 0-9, a-z, and "other." This will speed up maintenance greatly. You may have to alter the way you reference the images but believe me, it's worth it.