Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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!

share|improve this question
add comment

3 Answers

up vote 7 down vote accepted

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.

share|improve this answer
    
Huh, didn't even consider that. Nice answer! –  Kyle Cronin Mar 27 '12 at 23:14
    
@Kyle I saw the question and actually said, out loud, in my apartment, to nobody, "OH, I ACTUALLY KNOW THIS ONE!" –  Abby T. Miller Mar 27 '12 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. –  Kyle Cronin Mar 27 '12 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. –  Abby T. Miller Mar 27 '12 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. –  Chris W. Rea Mar 27 '12 at 23:45
show 2 more comments

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.

share|improve this answer
add comment

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
share|improve this answer
    
Thanks for the head start. –  Chris W. Rea Mar 27 '12 at 23:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.