This might be a bit of an odd one.
I have a collection on songs in iTunes and I'd like to copy it to an SDCARD to play it on my car's radio, together with the playlists I have to listen to the music in "proper order".
Copying the folder structure in
$HOME/Music/iTunes/iTunes Media/Music/ works fine, and the player can read the files.
As for playlists, iTunes allows exporting the playlists in
.m3u8 format. The paths in the playlist are in "OSX" format, but a quick sed one-liner changes the paths to relative ones and puts it in DOS format:
sed -i.bak -e 's:/Users/jjarava/Music/iTunes/iTunes Media/Music:..:g' -e 's:/:\\:g' "$1";
(the SDCARD in the car radio is identified as
I can see the playlist files in the car's radio, but only SOME of the files are "visible"/are played from the playlist.
Given that all the files "missing" contain some extended character (like
ú in Spanish). I've been bitten by the different way to encode the names in the past (see Linus Torvalds and the OS X Filesystem for context), so I suspect the issue might be due to the encoding of the file names in the SDCARD. When "browsing" the SDCARD I can see the authors/paths properly and all the files are available, so I think it's an issue of the way the paths are read from the .m3u file and (not) resolved to the proper files.
My first idea was to write yet another script to look for "offending" paths and rename them both in the filesystem and in the playlists, but I'm hitting a wall as find/grep etc seem to have issues working with files with extended characters on them. Something that "should" work like:
find /Volumes/MUSICA_VW/ -iname '*.mp3' | grep -e '[áéíóú]'
to get the offending songs/paths, returns every single song (i.e, the same results that
The option of renaming the files in iTunes is not really an option, as any time I add music it's got to be "processed". I don't care too much about having the proper paths etc in the player, that's why I wouldn't mind doing mass renaming etc as part of the "export" but the information on iTunes should be the right one...
So before delving in the arcane secrets of
findutils, or just byting the bullet and coding something in Python, any suggestions? I'm sure I'm not the first one to have hit this specific issue, I'm sure.
And to any that have taken the time to read so far, THANKS!
I've not tested this on a huge hierarchy of nested folders, but assuming you use List view, giving you the opportunity to Opt/click the reveal arrow & then select all -
The Finder since Yosemite has a built-in Search & Replace for file names.
Right click, Rename [n] items…
I just tested on some recipe text files I intentionally added accented letters to, but it ought to work on any file…
It does mean you'd have to go through each replacement, one at a time, á é í ó ú etc but it would get there in the end.
TextWrangler could do the same for the m3u file.