Google Music Beta won't upload mp3's with spaces in the actual filename. I would like a script that will find all the ones that have a space in the filename and copy them, rename them (just remove the spaces, or replace with underscore), and put them in a new directory so that it doesn't screw up my iTunes library. Thanks in advance! Also, i am running OS X.
feedback
|
migrated from stackoverflow.com Jun 7 '11 at 17:51
This question came from our site for professional and enthusiast programmers.
|
I don't remember if Perl comes installed on OS X by default, but if you have it, you can use this script to clean up your file names. Right now, it removes parentheses and apostrophes, and converts everything to lower case. You can add the line
to remove spaces, or
to convert spaces to underscores. Save the script to your MP3 directory, then call the following from the command line:
| |||||
feedback
|
Renaming them in a for loop...
... results in:
This works for all the files in your current working directory. It's a little ugly because mv gives an error for all the files that do not contain spaces, but it does it's job. The | |||
|
feedback
|
