Create a gist now

Instantly share code, notes, and snippets.

Quick and dirty script to get track names, artist names, and album names from an iTunes XML dump and output a CSV
require 'csv'
track = /<key>Name<\/key><string>(.*)<\/string>[.\s]*<key>Artist<\/key><string>(.*)<\/string>[.\s]*<key>Album<\/key><string>(.*)<\/string>/
file ="Library.xml", "r")
contents =
out ="Library.csv", "w")
contents.scan(track) do |match|
out << match
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment