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.

@Kyle I saw the question and actually said, out loud, in my apartment, to nobody, "OH, I ACTUALLY KNOW THIS ONE!"
–
abby hairboat♦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 CroninMar 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 hairboat♦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. ReaMar 27 '12 at 23:45

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:

Please consider giving www.iTunesStats.com a try. It is a Visual Basic script I wrote that loops through your iTunes library and provides a text file of all kinds of statistics. It then puts those stats into a .csv file for you to keep long-term.

This could be a really interesting answer to the problem but it suffers from: 1) a lack of example output that shows specificallly how it answer the question being asked; and 2) instructions for how you would use it on a Mac (remember, this is an Apple site and iTunes runs on both Windows and Apple machines). If you added some more detail you might find you're not attracting down votes.
–
Ian C.♦Mar 29 at 19:12