Friday, December 29, 2006

how to process an exported playlist

this is the no XML, no AppleScript method


  1. select the playlist
  2. menu: [File][Export...]

    (system will open a dialog titled "Save: iTunes")
  3. set the 'save as' filename to "myPlaylist.txt" (optional-- but it makes the example easier)
  4. set format to "Plain Text"
  5. press [Save]
  6. open the terminal
  7. cd to the directory where it was saved (I think default is Documents)
  8. here's the magic: (enter it all on one line)

    awk 'BEGIN {RS="\r"; FS="\t"; OFS="\t"} {print $1, $2 }' myPlaylist.txt

    or

    awk 'BEGIN {RS="\r"; FS="\t"; OFS="\t"} {print $1, $2 }' myPlaylist.txt > cleanedPlaylist.txt

1 comment:

Anonymous said...

i love this. so handy!

i dont know who the hell needs the playlist exported in teh way that itunes does it now.