PDA

View Full Version : Batch Renaming files from Excel spreadsheet




MMPhotog8
Sep 9, 2009, 02:19 PM
I do all the product photography for a company. We work with a company that uses a different file naming convention. They have PFID's which look like this: 33-39477.tif while I use SKU's that look like this frt-FTBLWOO300.tif
The images we put online to our website have to have the SKU name so it links correctly. I receive hundreds of images at a time from this other company and need to quickly re-name the files from the PFID to the SKU name. I have a list of our complete inventory (roughly 23,000+) in an excel spreadsheet with column A having the PFID and column B having the sku in it. Can I use this spreadsheet to batch re-name files?

I downloaded "A Better Finder RENAME" from this website - http://www.publicspace.net/ABetterFinderRename/Manual_Rename_File_List7.html
but I am having trouble following the directions on how to use a list to re-name. Is there a better program or solution?
I want to be able to dump edited PFID files into a folder on my desktop, push a button, and have the new renamed file in another folder on the desktop. :)



tofagerl
Sep 9, 2009, 02:23 PM
It'll take a bit of batch magic, but should be doable. Keywords to google: CSV (comma separated values. You can save your excel document to this format), grep and rename

MasConejos
Sep 10, 2009, 12:55 PM
I have written a ruby script and posted (http://roguepenguin.net/PFID2SKU/) it. (Ruby is installed by default on Leopard and Snow Leopard, probably Tiger).

The CSV is just a sample I made for testing, you can ignore it if you wish

I have tested it on windows and linux, as I'm not near my mac.

The beginning of the file has documentation, configuration, and usage instructions (just open it up in a text editor to view it)

If you have any other questions on it, let me know.

(If you don't like/want/need it, that's fine too)

Eccleshall
Aug 16, 2011, 10:12 AM
I have downloaded the ruby file thats you uploaded, but i keep getting a error "does not appear to be a valid mapping" could you please advise me what I'm doing wrong

Thanks

MasConejos
Oct 3, 2011, 09:56 PM
I have downloaded the ruby file thats you uploaded, but i keep getting a error "does not appear to be a valid mapping" could you please advise me what I'm doing wrong

This error happens if a line in the csv file fails to have exactly two entries. It should report which line has the error.

Expected Format:

33-39477.tif,FTBLWOO300.tif


Error Formats:

33-39477.tif
33-39477.tif,FTBLWOO300.tif,xxyyzz
33-39477.tif,FTBLWOO300.tif,33-39478.tif,FTBLWOO301.tif