This isn’t mysql related yet, but it will be. It’s the first step in writing my own itunes xml parser so that I can put all of my xml information into a database for other relational processing.
I was needing to copy my songs to a GPS device that I use on my motorcycle (it plays mp3s too). And since I didn’t want to burn a cd and then rip the tracks back to my GPS, I figured I’d export the playlist as XML and then initiate some awk/sed to clean the xml data, then scp the files from the music server to my sd card.
The code!
#!/bin/sh
cat inputfile.xml |grep "Location” | awk -F “” {’print $2′} | sed
’s/<\/string>//g’| sed ’s/\%20/\\\\ /g’ | sed
’s/file:\/\/localhost//g’ | while read line; do
echo $line
scp media@192.168.0.103:”$line” TO_GARMIN/
done
Which, after encountering some badly named files from iTunes ripping… the …
[Read more]