Batch Renaming files from Excel spreadsheet

Discussion in 'Mac Programming' started by MMPhotog8, Sep 9, 2009.

  1. MMPhotog8 macrumors newbie

    Joined:
    Sep 9, 2009
    #1
    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. :)
     
  2. tofagerl macrumors 6502a

    tofagerl

    Joined:
    May 16, 2006
    #2
    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
     
  3. MasConejos macrumors regular

    MasConejos

    Joined:
    Jun 25, 2007
    Location:
    Houston, TX
    #3
    I have written a ruby script and posted 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)
     
  4. Eccleshall macrumors newbie

    Joined:
    Aug 10, 2011
    #4
    File Uploaded error

    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
     
  5. MasConejos macrumors regular

    MasConejos

    Joined:
    Jun 25, 2007
    Location:
    Houston, TX
    #5
    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
     
  6. soaringchicken macrumors newbie

    Joined:
    Jul 31, 2012
    #6
    This is awesome! May I make a simple request?

    I am in a similar situation where I need to rename many files in a way more complex than automator can handle.

    I have hundreds of video files which I have told automator to rename the files based on their "date modified metadata" with the setting as "seconds from noon" the only problem is they are all off by 2520 seconds, and in order to matchup with my other cameras accurate time data they all need to be altered so their names are +2520 seconds.

    I could bring all the names into excel and do that math quickly, then export the final list as a CSV but I don't know how to tell finder to rename all the orignals with the new names in the excel exported .csv.

    Thanks!
     
  7. sclyman macrumors newbie

    Joined:
    Feb 28, 2009
    #7
    Error

    I tried using this on a Mac, and got the below error...help?

    PFID2SKU.rb:45: syntax error, unexpected tIDENTIFIER, expecting end-of-input
    require "ftools"
     

Share This Page