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.



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.

| 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!" – 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 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. – 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. Rea Mar 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:

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
| improve this answer | |

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.

| improve this answer | |

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.

| improve this answer | |

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.

| improve this answer | |

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.

| improve this answer | |
  • 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 '15 at 19:12
  • If you put the Visual Basic in an Excel file, it will also run on most Mac versions of Office. LibreOffice can open the Excel file, but I am not sure whether it can run VBA. – WGroleau Nov 5 '17 at 21:08

You must log in to answer this question.

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