Skip to content

Instantly share code, notes, and snippets.

Created Sep 25, 2012
What would you like to do?
Copy all songs in a .m3u file exported via iTunes to a new directory
IFS=$'\n'; mkdir playlist; for FILE in `tr "\r" "\n" < playlist.m3u | grep -v "^#"`
SONG=`basename $FILE`
ALBUM=`basename ${FILE/$SONG//}`
ARTIST=`basename ${FILE/$ALBUM\/$SONG//}`
cp $FILE "./playlist/$ARTIST - $ALBUM - $SONG"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment