Convert Databse into CSV
#1
Hi,

i'm searching for a way to convert the entire database (videodb.xml) into a CSV file to import that in libreoffice calc. i've found a template to do this with msxml.exe, but this template only exports some tags and i have not figured out how to add the other tags to the template. this is the template:

Code:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict">
<xsl:output method="text" indent="no" encoding="UTF-8"/>


<xsl:template match="videodb">
<xsl:text>Title;Year;IMDB Rating;Genre;Path and Filename</xsl:text>
<xsl:text>&#xD;&#xA;</xsl:text>
<xsl:for-each select="movie">
<xsl:sort select="title"/>
<xsl:value-of select="title"/>
<xsl:text>;</xsl:text>
<xsl:value-of select="year"/>
<xsl:text>;</xsl:text>
<xsl:value-of select="rating"/>
<xsl:text>;</xsl:text>
<xsl:value-of select="genre"/>
<xsl:text>;</xsl:text>
<xsl:value-of select="filenameandpath"/>
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>

it's no problem to add other xml tags that are in the 'movie'-tag. i have problem to work with the fileinfo tags:

Code:
<fileinfo>
            <streamdetails>
                <video>
                    <codec>h264</codec>
                   ...
                </video>
                <audio>
                ...
                </audio>
            </streamdetails>
        </fileinfo>

i think i have to 'jump' to the fileinfo tag, then to the streamdetails tag and so on. but how can i do this in the template?
Reply
#2
Kodi database is not in an XML file unless you have exported it. Is that the case?
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#3
yes, i have exported the database and i try to convert the videodb to a csv file that i can open with libreoffice.

i'm searching for a xsl file that transforms ALL tags of the xml to csv. here is a file http://www.waldherr.org/howto-export-you...ry-to-csv/ but it only transforms a few tags and i'm not familiar with xslt to change it. its no problem to change the xsl file to export other tags directly in the 'movie-tag' but not the stream details (fileinfo/streamdetails/.../...).
Reply
#4
Googling " convert xml to csv" finds plenty of options.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#5
i've googled and i found nothing that helps.
Reply
#6
There seem to be plenty of conversion software and services
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply

Logout Mark Read Team Forum Stats Members Help
Convert Databse into CSV0