How to export your XBMC library to CSV

I have set up all my movies in XBMC and wanted to clean the library from movies which I’ll likely never watch. My idea is to export the library to plain text CSV format, read the file with Excel, filter for crappy IMDB ratings and remove the movies files. Here is how:

  1. Export your library to a single file from XBMC. The file likely ends up in C:\Documents and Settings\Administrator\Application Data\XBMC\userdata and is called videodb.xml.
  2. Convert the XML file to something Excel can read.
    1. Download the XSL file which sets the conversion format.
    2. Convert the file with a command line utility from Microsoft. Open a command window and use

      msxsl.exe videodb.xml convert.xsl > movies.csv

  3. Read movies.csv with Excel and analyze to taste.
  4. You’re done.

5 thoughts on “How to export your XBMC library to CSV

  1. Greg

    This is great — almost exactly what I’ve been looking to do for a long time! Thanks!

    How would I go about extracting information like ‘video codec’ or ‘audio codec’ or ‘aspect’? (I guess I have to take a look at the XSL syntax on a Microsoft site someplace, but if you had any quick-and-dirty information I could add to ‘convert.xsl,’ I’d appreciate it.)

    Reply
    1. Stephen Jesse

      If you still need help figuring that out. Please note that if you have movies like i,Robot you might want to open the file in notepad then past the contents into Excel then do Text-to-Columns (“;”). As if you have commas in the titles it will do interesting things when directly opening the CSV in excel.

      Just save this into the Convert.xsl I used Notepad++ to make the edits as it is a good editor and it is free. Hope this helps you. It will let you know all the audio formats and video if you have more then one in the video file.
      Don’t worry about the code not being tabbed for easier reading as that is purely to allow people to read it easier the computer could care less.

      #—————————————————————————————————–
      # Copy the Below Text

      Title;Year;IMDB Rating;Genre;Path and Filename;Codec;aspect;width;height;codec;channels

      ;

      ;

      ;

      ;

      ;

      ;

      ;

      ;

      ;

      ;

      ;

      Reply
  2. TorumSie

    I just wanted to chime in and thank you for this also! I needed both this exact thing and the same for TV shows. The xsl file was clean and easy to edit for my needs to give me one file for my movies and one for my tvshows, thank you again!

    Reply

Leave a Reply to TorumSie Cancel reply

Your email address will not be published. Required fields are marked *