12

Is there a way to export album/track information from an iTunes music library into, say, a comma-separated values (CSV) file, or another spreadsheet-friendly format?

I'd like to be able to grab a snapshot of at least basic metadata – being artist name, album name, and track name – and copy into a spreadsheet or database software for reference, cleansing, & analysis. (If you want to call me a music nerd for wanting to data-mine information about my CD collection, go right ahead! :-)

Is there a way to do such a metadata export within iTunes itself, or else might there be a third-party tool that can extract such information from iTunes library storage? Or perhaps you have a quick & dirty homebrew script of your own you could share here?

I'm aware there is XML somewhere in the bowels of my iTunes library, and I'm a programming nerd too, but I'm hoping somebody has already invented this particular wheel.

Thanks!

5 Answers 5

21

Make sure all the columns you want metadata for are visible in the playlist or library you're looking at. Then, select the tunes you want with shift-click or -click or whatever:

enter image description here

Then, hit +C to copy. This will allow you to paste what's visible in the iTunes playlist into any sort of spreadsheet you like:

enter image description here

It won't label the columns for you, but it'll do the trick quickly.

11
  • 1
    Huh, didn't even consider that. Nice answer! Mar 27, 2012 at 23:14
  • 1
    @Kyle I saw the question and actually said, out loud, in my apartment, to nobody, "OH, I ACTUALLY KNOW THIS ONE!"
    – hairboat
    Mar 27, 2012 at 23:18
  • 1
    I've been testing this out, and it works great for up to a few hundred rows, but I can't get it to work much beyond that. If the OP wants to do analytics on his entire library, he may want to use my method. Mar 27, 2012 at 23:24
  • @KyleCronin I'm not surprised. I imagine this functionality is mainly used to do stuff like make liner notes for burned CDs and such.
    – hairboat
    Mar 27, 2012 at 23:25
  • 1
    FWIW, I was able to export all ~1500 rows on my Mac's iTunes library, and all ~16000 rows on my Windows iTunes library. Also, I used Cmd-A (Windows: Ctrl-A) to select all rows, instead of the mouse. I may still resort to Kyle's method to automate this and get at raw bits instead. Both answers are excellent. Mar 27, 2012 at 23:45
12

You can do File -> Library -> Export Library and get an XML file of your library metadata. From there it would be a relatively straightforward matter for a programmer to convert the XML data into a CSV, spreadsheet, or database.

For example, I made this quick Ruby script in about 10 minutes to get the artist, album, and track names from the XML and output a CSV. Note that it will only match tracks that have all 3 pieces of info provided, and that it requires the library file to be called "Library.xml" in the current directory:

require 'csv'

track = /<key>Name<\/key><string>(.*)<\/string>[.\s]*<key>Artist<\/key><string>(.*)<\/string>[.\s]*<key>Album<\/key><string>(.*)<\/string>/

file = File.open("Library.xml", "r")
contents = file.read

out = CSV.open("Library.csv", "w")

contents.scan(track) do |match|
  out << match
end
0
3

For enhancements/tools to work with ITunes probably the first place to go is Doug's Applescripts for iTunes. There are many useful scripts here.

On the page for Exporting Info there is this script that exports track information as a text file.

This script will write a discrete alphabetical list of your choice of the Albums, Artists, Album Artists, Composers, Genres, Shows, or Track Names in iTunes to a text file.

1

One more option: exiftool will also extract ID3 tags from music files. One of its many options is to put them in a CSV file, one line per input file. You can also limit which tags it will pull.

0

One way to do this is to make a playlist with all your songs in it. Then you export the playlist as a text file. Next drag the text file into Excel and all your information should be organized. You can then save the excel sheet as a csv.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .