How do I rename a lot of files from an excel worksheet?

Hello all!
I have 2k+ files in a folder named sequentially from 0001.wav to 24xx.wav.
I have their contents referenced in an .xls.
This is a library made for Windows when it didn't accept very long names, so you couldn't just name the file accordingly.
So what I want to do is to rename these files taking the name from my excel sheet and pasting it on the file. To do that one by one is really too much.... Can anyone think of an automated (or semi-automated) way of doing this?
Thanks!!!

Hi again,
So I have a couple of questions, if you don't mind:
Of course not!
To hopefully make things more understandable, here's the script again with some line numbers I can refer to:
1 for details in `cat myspreadsheetdetails.csv`
2 do
3 OLD_NAME=`echo $details | cut -f1 -d,`
4 NEW_NAME=`echo $details | cut -f2 -d,`
5
6 echo "Renaming $OLD_NAME to $NEW_NAME"
7 mv $OLD_NAME $NEW_NAME
8 done
Firstly, some assumptions I've made.
1. The excel spreadsheet has 2 columns. Column A is the current name of the wav file, column B is the new name you want the wav file to have.
2. Both name in columns A and B have the .wav extension specified
3. None of the names have a space character in them. Eg. 'A cool song.wav'
4. The script is being run from the folder containing the files to be renamed.
Now, back to your questions:
1)where in the script am I telling in wich directory the files are?
The first thing we'd need to do in the Terminal, is change the working directory to where the wav files are located. The simplest way to do this is type 'cd ' (i.e. the cd followed by the space character) and then drag and drop the folder containing the wav files onto the Terminal window. That will populate the path and you can then press return to change to that directory.
Line #1 specifies the file name that details the old and new names. Let's assume you save the excel spreadsheet as a csv file and create the file on your Desktop as being called songs.csv. In this case, line #1 would become:
for details in `cat ~/Desktop/songs.csv`
(The ~ is a shortcut that means your home folder.)
2)will this script rename all the files automatically? I mean, when it finds 001.wav it will rename it to mynewtitle.wav and when it finds 004.wav it will rename it to mynewtitle4.wav? even if they are not sequential? even if not all the the files in the CSV are present in the directory, or viceversa?
The script currently does not do anything more complex than follow what is present in the spreadsheet. So for example, if you have the following data:
<pre style="font-family:'Courier New';">
Column A | Column B
0001.wav | MyNewTitle.wav
0002.wav | SomeOtherTitle.wav
2304.wav | Test123.wav
0003.wav | GreatSong.wav
</pre>
it will rename, 0001.wav to MyNewTitle.wav, 0002.wav to SomeOtherTitle.wav, 2034.wav to Test123.wav and so on. The names themselves are irrelevant.
If that's not what you want, can you give me a few examples?
3)what do you mean by testing? how can I test the script without actually renaming the files?
The only command that actually 'does' anything is line #7. When copying the commands in the Terminal if you skip that one line, then when you run it, the echo statement on line #6 will just print to the screen what it would do, without actually doing anything.
If you can post a sample of the spreadsheet that should help me confirm I'm not going to trash your files
If none of that made sense, just yell and I'll try to rephrase.

Similar Messages

  • How do I uninstall an add on file from the Seamonkey browser?

    HOW DO I UNINSTALL AN ADD ON FILE FROM MY SEAMONKEY BROWSER?
    Mozilla needs to make their products more user friendly. There is a multitude of people out there
    who are "NOT" very computer literate. Older people like myself, for example, who are old
    school, have a difficult time being dragged kicking and screaming into the electronic generation.
    My grandchildren are better at this kind of stuff than I am; yet we really don't have much choice
    but to try and make the transition, because I have found that there are a lot of types of business
    that you cannot get done unless you are willing to do it with a computer, going online.
    My problem is not with Firefox (I don't use it because it is too slow) , because I use the Seamonkey browser. The problem I now have is that when I try to download some software, I get a message that says I must first uninstall a certain “add on” file, (npfdm.dll.), a "Free Download Manager" file. When I get the list of add ons through the “help” drop down menu, there is “NO” link or any way I can see that will allow me to uninstall this file from the add on list. Therefore, Seamonkey becomes useless to me. Someone please help me with this. Thank you.
    Tim Applegarth
    Phone: xxx-xxx-xxxx
    Email: [email protected]
    edit removed email/phone number as only spambots will be making use of them though it may be too late as this is a public forum.

    SeaMonkey support is over here - http://forums.mozillazine.org/viewforum.php?f=40

  • How to make Finder NOT to show files from a specific folder in "All My Files"?

    Hello!
    Can someone please advice how to make finder NOT to show files from a specific folder in "All My Files"? See the attach - I recently installed Civilization 5 from Steam and now I have a lot of unneeded files (*.log and *.ini) shown in  All My Files colder in Finder.
    I don't want to see them. Any advise?

    Using "All my Files" was very handy before all this rubbish popped up. =(

  • How do I copy my old xl files from my XP machine to operate on xl for Mac on my new iMac.  When I copy them onto a stick and transfer them it automatically makes them xls files which are then corrupted when I try to open them in xl for mac

    How do I copy my old xl files from my XP machine to operate on xl for Mac on my new iMac.  When I copy them onto a stick and transfer them it automatically makes them xls files which are then corrupted when I try to open them in xl for mac

    Sorry, yes this is Microsoft Excel.  The Microsoft XP has Excel files denoted as xl, the later versions of Microsoft Excel are denoted as xls files.  The later verions of Microsoft Excel open the xl files OK, does Excel for Mac not able to do this?

  • I have a power pc (g5) computer that I will soon be replacing with a current i5 or i7 mini. How do I transfer the Time Machine files from the internal hard drive on the G5 to an external drive that I will later use with the Mini?

    I have a Power PC G5 computer that I will soon be replacing with a current i5 or i7 Mini. How do I transfer the Time Machine files from the internal hard drive on the G5 to an external drive that I will later use with the Mini?

    Hi, likely the easiest is to just poll the drive & get something like this...
    Get MacScan...
    http://www.apple.com/downloads/macosx/networking_security/macscan.html
    http://eshop.macsales.com/item/NewerTech/U3NVSPATA/
    But if you have a good external drive already, just clone it.
    Get carbon copy cloner to make an exact copy of your old HD to the New one...
    http://www.bombich.com/software/ccc.html
    Or SuperDuper...
    http://www.shirt-pocket.com/SuperDuper/

  • How can i export a 24bit avi file from photoshop for mac?

    how can i export a 24bit avi file from photoshop for mac? i have a client that specificly needs the files to be avi and in 24bit what are the settings that i need to use to export the video using photoshop on a mac?

    Hello,
      To make a 24-bit AVI file in Photoshop, go to File>Export>Render Video. Then, under File Options, choose AVI from the Quicktime Export drop-down menu. Click the Settings button. Click the Settings button in the AVI Settings window. Change Compression to None, and then choose "Millions of Colors" from the Depth drop-down under Compression.
      The Millions of Colors option is for 24-bit video (8-bit R+G+B channels, 8x3=24). Millions of Colors+ is for 32-bit video (24-bit video plus an 8-bit alpha channel).
    -Brett

  • How do I remove an unopenable video file from my sidebar?

    How do I remove an unopenable video file from my sidebar?

    Found the answer in more like this. Thanks Barney!

  • How can I copy programs (iWorks) and files from Time Capsule to my HD manually? The problem is that the migration assistant does not recognize my backup file and the user on the TC. (If I open the TC on finder, it it there though)

    How can I copy programs (iWorks) and files from Time Capsule to my HD manually? The problem is that the migration assistant does not recognize my backup file and the user on the TC. (If I open the TC on finder, it it there though)

    How can I copy programs (iWorks) and files from Time Capsule to my HD manually? The problem is that the migration assistant does not recognize my backup file and the user on the TC. (If I open the TC on finder, it it there though)

  • How can I clean all the junk files from my iMac so that it can run faster?

    How can I clean all the junk files from my iMac so that it can run faster? Its been slowing down ever since I started using it.

    Before doing anything, we might be able to help with your iMac issues here.
    Please download, install and run Etrecheck.
    http://www.etresoft.com/etrecheck
    Copy/paste its report here in another reply thread so that we have a complete profile of your Mac's hardware and installed software.

  • How can I transfer all of the files from my old iPhone 4S to my new iPhone 5?

    how can I transfer all of the files from my old iPone 4S to my new iPhone 5?

    Download the media content from an iTunes library or the iTunes Store, and follow these instructions to transfer your personal settings and data.
    (83108)

  • How can i transfer the radio recording files from my Ipad to Computer

    how can i transfer the radio recording files from my Ipad to Computer ?

    I was hopeful I could use home sharing to sync my iTunes libraries,
    Unfortunately, you can only stream content to your iOS devices via home sharing (not sync it).
    I'd have a check through the following user tip instead:
    Recovering your iTunes library from your iPod or iOS device

  • HT1382 how can I restore my back up files from my laptop? i want to see the dates and time that I backed up  my files. is it posssible?

    how can I restore my back up files from my laptop? i want to see the dates and time that I backed up  my files. is it posssible?

    What backed up files?
    Available backups for an iOS device can be found in Edit > Preferences > Devices.

  • How can I keep my RAW photo files from converting to JPEG???

    How can I keep my RAW photo files from converting to JPEG???

    Hello briggiebunny
    If iTunes can read the movie files, then you will need to create an iPad version by going to the drop down menu File > Create New Version > Create iPad or Apple TV Version and then syncing that newly created file.
    iTunes: Videos may be unable to sync to iPhone, iPad, or iPod
    http://support.apple.com/kb/ts1497
    Regards,
    -Norm G.

  • How do I access my back up files from the time machine if my computer was stolen?

    Hi, how do I access my back up files from the time machine if my mac book pro was stolen? I have a mac book air and mac too. But not sure how I can get back all the files from the stolen computer from my time capsule

    On the Mac Book Air or other Mac that you have, use Migration Assistant to transfer files from the Time Machine backups of the Mac that was taken.
    Macintosh HD > Applications > Utilities > Migration Assistant

  • How do I export wmv and avi files from media encoder on a mac in CC2014

    How do I export wmv and avi files from media encoder on a mac in CC2014?

    John T Smith wrote:
    As far as I know, you don't... those are Windows formats that are not available on a Mac
    Nonsense.
    Apple Compressor has been doing wmf exports for a decade. I have the Quicktime export components from Telestream and they appear as presets in Compressor. They should be available in Media Encoder or they should be importable. Adove apparently refuses to see them. Still trying to figure that out.

Maybe you are looking for