You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How can I view iTunes export playlist xml file in a readable format?

Please read this carefully before telling me what I already know (that it's a iTunes-only readable format, not meant to be viewed by me, etc.).


I exported several playlists to xml a short while ago. Since then, I have deleted the music off iTunes and my computer in order to make space (which is why I made the backup xml file in the first place, I thought I could extract all the information from that later). If I try to import the xml file through iTunes, it just tells me that there's music missing. NOT WHAT I NEED. I'm trying to find the exact playlist as it was at the time that I saved the file, in exact order, etc. Is there ANY kind of xml viewer that will allow me to see this in any user-friendly way without having to sort through layers and layers of nonsensical code?


And why doesn't iTunes make it easy for me to save a playlist in text format? Wouldn't that be be the most logical use of exporting playlists? I'm freaking out right now, knowing there's no conceivable way I will be able to recreate my playlists without the use of this file.


Thanks for anyone who can help.

iPhone 6, iOS 9.1, Windows 7, latest version of iTunes

Posted on Nov 24, 2015 8:10 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 25, 2015 6:06 PM

When iTunes imports a playlist file it checks for the presence of each file listed. If it cannot find the media file at the specified path that entry from the playlist is ignored. Even if iTunes were able to import those entries from the list it would then show them in the library with exclamation marks and the tracks could not be played, because they don't exist. If you have the files, but have moved them to a different location, then it may be possible to edit the XML to take this into account. iTunes can export in .m3u and .m3u8 formats which have a simpler structure, generally a comment line followed by a path. The XML includes more information about each track, including a track ID and a path. Later in the XML one or more playlists can be defined as a list of track IDs. It would be possible to thin out the XML so that all you see is the track IDs and their paths, or potentially a script could take the XML and spit out one or more M3U files that represent the playlists.


Do these playlists still exist on your iPhone? If so I have a script that can extract and recreate them in iTunes, even if the media paths have been changed, however you do need all of the media files stored somewhere? They can be extracted from your device if necessary. Do you have a backup of the ITL file that the XML file was exported from? iTunes sometimes makes backups in the Previous iTunes Libraries folder during iTunes updates. I have techniques for fixing problems with missing media in the ITL if you do.


tt2

19 replies
Question marked as Top-ranking reply

Nov 25, 2015 6:06 PM in response to budarc

When iTunes imports a playlist file it checks for the presence of each file listed. If it cannot find the media file at the specified path that entry from the playlist is ignored. Even if iTunes were able to import those entries from the list it would then show them in the library with exclamation marks and the tracks could not be played, because they don't exist. If you have the files, but have moved them to a different location, then it may be possible to edit the XML to take this into account. iTunes can export in .m3u and .m3u8 formats which have a simpler structure, generally a comment line followed by a path. The XML includes more information about each track, including a track ID and a path. Later in the XML one or more playlists can be defined as a list of track IDs. It would be possible to thin out the XML so that all you see is the track IDs and their paths, or potentially a script could take the XML and spit out one or more M3U files that represent the playlists.


Do these playlists still exist on your iPhone? If so I have a script that can extract and recreate them in iTunes, even if the media paths have been changed, however you do need all of the media files stored somewhere? They can be extracted from your device if necessary. Do you have a backup of the ITL file that the XML file was exported from? iTunes sometimes makes backups in the Previous iTunes Libraries folder during iTunes updates. I have techniques for fixing problems with missing media in the ITL if you do.


tt2

Nov 25, 2015 8:07 AM in response to turingtest2

Thank you for the in-depth response. I appreciate you taking the time to help me.


The music is gone from my phone so it's the same problem with incomplete playlists. I really thought that by saving it in xml format, that it would be available for me to reference in an easy-to-read spreadsheet format (track, title, artist, album), but when I open it in Excel or whatever, it's all gobbledy-gook. At this point, all I want is to be able to access a list of all the songs in playlist order, so I'm hoping for some kind of simplistic xml viewer. I have all the music saved on various hard drives, so it's too hard for me to recreate the iTunes library otherwise. I checked for backups of ITL, but everything is too current. Next time I will definitely try exporting to a simpler format, but for now it seems like I'm screwed.


It would be possible to thin out the XML so that all you see is the track IDs and their paths, or potentially a script could take the XML and spit out one or more M3U files that represent the playlists.

Could you elaborate more on this part? Would the track ID contain the information I need (titles, artists) in the playlist order? M3U would work too, as long as it contains all the songs in the playlist, and not just the ones left on my computer. Thanks again!

Nov 25, 2015 6:06 PM in response to budarc

I've written several scripts for working with iTunes here: http://samsoft.org.uk/iTunes/scripts.asp


This is the M3U output for a one track playlist.


#EXTM3U

#EXTINF:215,Boogie Oogie Oogie - A Taste Of Honey

D:\iTunes\iTunes Media\Albums & Tracks\A\A Taste Of Honey\Beauty & The Boogie\01 Boogie Oogie Oogie.mp3

The lines that start with a # are ignored on input.



This is the XML output for a one track playlist. The important lines are highlighted in bold navy (bold wasn't distinct).


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>Major Version</key><integer>1</integer>

<key>Minor Version</key><integer>1</integer>

<key>Date</key><date>2015-11-25T16:49:10Z</date>

<key>Application Version</key><string>12.3.1.23</string>

<key>Features</key><integer>5</integer>

<key>Show Content Ratings</key><true/>

<key>Music Folder</key><string>file://localhost/D:/iTunes/iTunes%20Media/</string>

<key>Library Persistent ID</key><string>CCF046191585EA85</string>

<key>Tracks</key>

<dict>

<key>156289</key>

<dict>

<key>Track ID</key><integer>156289</integer>

<key>Name</key><string>Boogie Oogie Oogie</string>

<key>Artist</key><string>A Taste Of Honey</string>

<key>Album Artist</key><string>A Taste Of Honey</string>

<key>Composer</key><string>Janice Marie Johnson/Perry L. Kibble</string>

<key>Album</key><string>Beauty &#38; The Boogie</string>

<key>Genre</key><string>R&#38;B</string>

<key>Kind</key><string>MPEG audio file</string>

<key>Size</key><integer>2559268</integer>

<key>Total Time</key><integer>215928</integer>

<key>Track Number</key><integer>1</integer>

<key>Track Count</key><integer>1</integer>

<key>Year</key><integer>1997</integer>

<key>Date Modified</key><date>2015-10-28T16:04:45Z</date>

<key>Date Added</key><date>2013-01-26T16:08:09Z</date>

<key>Bit Rate</key><integer>94</integer>

<key>Sample Rate</key><integer>22050</integer>

<key>Comments</key><string>Test Comment 3

Multi

Line</string>

<key>Play Count</key><integer>11</integer>

<key>Play Date</key><integer>3513787411</integer>

<key>Play Date UTC</key><date>2015-05-06T19:03:31Z</date>

<key>Skip Count</key><integer>4</integer>

<key>Skip Date</key><date>2015-06-09T23:36:17Z</date>

<key>Rating</key><integer>40</integer>

<key>Album Rating</key><integer>40</integer>

<key>Album Rating Computed</key><true/>

<key>Normalization</key><integer>1216</integer>

<key>Artwork Count</key><integer>1</integer>

<key>Sort Album Artist</key><string>A Taste Of Honey</string>

<key>Sort Artist</key><string>A Taste Of Honey</string>

<key>Persistent ID</key><string>673E33095C0F1341</string>

<key>Track Type</key><string>File</string>

<key>Location</key><string>file://localhost/D:/iTunes/iTunes%20Media/Albums%20&# 38;%20Tracks/A/A%20Taste%20Of%20Honey/Beauty%20&#38;%20The%20Boogie/01%20Boogie% 20Oogie%20Oogie.mp3</string>

<key>File Folder Count</key><integer>6</integer>

<key>Library Folder Count</key><integer>1</integer>

</dict>

</dict>

<key>Playlists</key>

<array>

<dict>

<key>Name</key><string>Short List (XML Test)</string>

<key>Description</key><string></string>

<key>Playlist ID</key><integer>2026728</integer>

<key>Playlist Persistent ID</key><string>C49DA89513E61CBD</string>

<key>All Items</key><true/>

<key>Playlist Items</key>

<array>

<dict>

<key>Track ID</key><integer>156289</integer>

</dict>

</array>

</dict>

</array>

</dict>

</plist>


A script could read through the XML reading one line at a time and export something like this:

156289=file://localhost/D:/iTunes/iTunes%20Media/Albums%20&#38;%20Tracks/A/A%20Taste%20 Of%20Honey/Beauty%20&#38;%20The%20Boogie/01%20Boogie%20Oogie%20Oogie.mp3

<NextID>=<NextPath>

or better yet

156289=D:\iTunes\iTunes Media\Albums & Tracks\A\A Taste Of Honey\Beauty & The Boogie\01 Boogie Oogie Oogie.mp3

<NextID>=<NextPath>

etc.

from the initial list of tracks. and then spit out

Short List (XML Test)

156289

<NextID>

etc.

for each embedded playlist. You could then import these sections into sheets in Excel and lookup the IDs to create a list of paths. In fact with a dictionary object I could do the lookups in the script.


Would that be the sort of thing that you want?


tt2

Nov 25, 2015 6:10 PM in response to turingtest2

Yes, that would definitely be preferable to what I'm working with at the moment. Except the file path isn't as important to me as the Name/Artist/Album combo, so I would probably use the m3u output instead. Unfortunately, that's the extent of my knowledge when it comes to the use of scripts and codes. I've perused your site and I'm not sure what to do next. Again, thanks for all of this information, I'm starting to have hope now that everything can be salvaged!

Nov 26, 2015 1:34 AM in response to budarc

The key piece of data that makes an imported playlist useful to the application is the file path, and the file needs to exist. With a well formed library you can pick out the artist, album, and track name from the path. Nevertheless it should be easy enough to pick up the data that matters to you. Details are easy to fix once the general process is in place. I will try to get something worked out later today.


tt2

Nov 26, 2015 12:55 PM in response to budarc

OK, I've got to the point where I can drag an XML file onto a script and have it list out selected data. Currently it is just going on screen but writing to a file, or perhaps many is easy enough. So far it scans through the tracks storing up the IDs and their associated locations, then it spits out the names of each playlist followed by the path to each track in that list for as many playlists as are in the XML. I could output the data to a single plain text file, or create a number of valid .m3u files for each non-empty playlist if you're happy to work from the location data. The question I have now is what exactly do you want to export? If you'd rather have something other than the path, or in addition to it, then I can work that in.


tt2

Nov 26, 2015 1:46 PM in response to turingtest2

Sounds great, thanks. Sorry, I didn't mean for this to be so complicated! A plain text file would be great, with file path, song title, artist and album listed alongside would be ideal. Just enough information so I know how to recreate each playlist exactly, track by track, in the order I originally played them in. Thanks so much for doing this, I still can't believe there's not an easier way to get around this! But grateful for your help.

Nov 26, 2015 1:59 PM in response to budarc

Do you want artist, with album artist if artist is blank, or the other way around?


If I do something like this:


Playlist | <Playlist name>

<Name> | <Album> | <Artist> | <Location>

<Name> | <Album> | <Artist> | <Location>

<Name> | <Album> | <Artist> | <Location>


Playlist | <Playlist name>

<Name> | <Album> | <Artist> | <Location>

<Name> | <Album> | <Artist> | <Location>

<Name> | <Album> | <Artist> | <Location>


where the | character is replaced by a tab then you could import in to Excel and the data would fall into columns.


tt2

Nov 26, 2015 2:19 PM in response to turingtest2

Yup! I'm super organized about my music, so all the Album Artist entries would either be the same as Artist or listed as "Various Artists." So it would be mostly duplicate information.


Just want to say thanks, thanks, THANKS again for doing this for me. There's no real hurry at this point, so don't inconvenience yourself any further on my account. And also, F YOU to Apple and iTunes, who made this so unnecessarily difficult to save text versions of my playlists for future reference! And how dumb is it that if I delete music from my library, it irreparably deletes it from my playlists (not even an empty value) for all time? /venting

Nov 27, 2015 1:35 PM in response to budarc

How big was the library? How many large playlists do you think you have? I ask because although the output is fine on a test library, with my own admittedly large library it has exceed the capacity of programs to read it as a single file. Neither Notepad, Notepad++ or Word can read it as a text file (over 512Mb!), and I'd need to split it into at least thirty Excel spreadsheets. Actually thinking about it the main library playlist is too big for a single Excel sheet.

User uploaded file


Of course I could output each playlist as a separate file, but where am I going to store 393 of them? Well I don't really need them, but I need to consider how best to organize the output for you if a single file is going to be too big. I can also suppress output of the Library and Music playlists. Empty playlists and playlist folders are already ignored.


Here is the text output from a test library.

User uploaded file


And as CSV imported into Excel.

User uploaded file


Are you sure you wouldn't prefer the latter format?


It is somewhat unfortunate that you didn't inspect the files that you had saved before discarding your media files. I'm not at all surprised that iTunes deletes all of the references to a track if you delete it from the library. Why would you delete it if you were going to bring it back later? Had you removed the physical files leaving the database alone then it would have kept the broken entries even though it wouldn't have been able to locate a track to play.


tt2

Nov 27, 2015 5:24 PM in response to turingtest2

Wow, this is getting really complicated. How come the output file is so big? Each playlist had maybe 100-200 songs each (or less). Why does it have to spit out your entire library, and not what's just available on the playlist file (or does the playlist contain the entire library, for some reason?). Each playlist into a separate file would work for me, since I have maybe 10 playlists I'm talking about here. You're right, the Excel file looks a lot more organized and easier on the eyes. (Again, Name/Artist/Album order would be my preference.)

I guess my mind works differently than other people. I feel like it would make sense to delete music from your iTunes library, because if you delete it directly from your computer and then add it again later, iTunes adds a duplicate file (so the deleted ones would still exist in the library alongside the newly imported ones, but they would be broken links). If I didn't delete it from the library first, it would get cluttered with empty duplicates all the time. But if I add something to the playlist, unless I delete it from the playlist specifically, I wouldn't want it to be deleted as soon as the library item was gone. Most of my problems come from hard drive space issues, since I'm constantly removing/adding new music from my computer/phone due to lack of space. After a while, I have no choice but to delete old music if I want to make room for new ones (but I'd still like those playlists to exist for future reference, completely intact). Sorry, this whole paragraph went off on a tangent. Next time I think I'll just copy/paste the entire playlist into a text file (or paste the actual files into a separate folder) since this has gotten way more technical than I ever intended it to. 😕

Nov 27, 2015 6:35 PM in response to budarc

Let's see how you get on with a single file. If it is too big then once I know how many track records are exported I can think of the best way to break up the output. The script is called TransformXML.vbs. Right-click on the link and use Download or Save As, save it in the same place as the XML file, then drag & drop the XML onto it. I've swapped the order of artist and album around in the output, and suppressed the listing of the whole library and the default music playlist.


tt2

How can I view iTunes export playlist xml file in a readable format?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.