Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted

Hello, i got for all acrade roms a gamelist.xml with all infos like:

game id="39876" source="ScreenScraper.fr">
		<path>./1943kai.zip</path>
		<name>1943 Kai: Midway Kaisen</name>
		<desc>An update of 1943 with tweaked weapons, fewer levels, and a new soundtrack.</desc>
		<rating>0.7</rating>
		<releasedate>19870101T000000</releasedate>
		<developer>Capcom</developer>
		<publisher>Capcom</publisher>
		<genre>Shoot'em up / Vertical-Shoot'em Up</genre>
		<players>1-2</players>
		<image>./mixart/1943kai.png</image>
		<marquee>./wheel/1943kai.png</marquee>
		<video>./snap/1943kai.mp4</video>
		<hidden>false</hidden>
		<favorite>false</favorite>
	</game>

 

Is there a tool or how could i convert this xml to a GameEx database?

I'm only interested on description, date, rating etc

Posted
19 hours ago, starx said:

Hello, i got for all acrade roms a gamelist.xml with all infos like:



game id="39876" source="ScreenScraper.fr">
		<path>./1943kai.zip</path>
		<name>1943 Kai: Midway Kaisen</name>
		<desc>An update of 1943 with tweaked weapons, fewer levels, and a new soundtrack.</desc>
		<rating>0.7</rating>
		<releasedate>19870101T000000</releasedate>
		<developer>Capcom</developer>
		<publisher>Capcom</publisher>
		<genre>Shoot'em up / Vertical-Shoot'em Up</genre>
		<players>1-2</players>
		<image>./mixart/1943kai.png</image>
		<marquee>./wheel/1943kai.png</marquee>
		<video>./snap/1943kai.mp4</video>
		<hidden>false</hidden>
		<favorite>false</favorite>
	</game>

 

Is there a tool or how could i convert this xml to a GameEx database?

I'm only interested on description, date, rating etc

This might help or try  http://www.xml-converter.com/

 

Posted

Hi Ian, We had the following functionality added by Tom to create mame xml files for use in PinballX - 

I think what @starx is looking for is a reverse of a similar process for use of an xml within GameEx that contains specific infos which is not possible, but maybe with more details fleshed out (such as original  source of xml file he is converting) should be submitted as an Enhancement Request here:

 

Posted

Yes, the xml file comes from retropie. Good detailed database. 

I had to convert it myself :) Here is python code that reads the xml file and convert it to a csv file. delimeter is | (pipe) and strings are quoted with ~

You can import this csv to a sqllite db using this tool: https://sqlitebrowser.org/

from xml.etree import cElementTree as ET

tree = ET.parse("gamelist.xml")
root = tree.getroot()

a=1
file = open('gamelist.csv','w',encoding='utf-8')

for page in root.findall('game'):
    desc = page.find('desc')
    name = page.find('name')
    filename = page.find('path')
    developer = page.find('developer')
    publisher = page.find('publisher')
    genre = page.find('genre')
    releasedate = page.find('releasedate')
    rating = page.find('rating')
    


    #if desc is not None:
    filename = filename.text.replace('./','').replace('.zip','')
    print("desc: ", filename)



    file.write(str(a)+'|')
    file.write(name.text+'|')
    file.write('|') #cloneof
    file.write('|') #no clone
    file.write('|') #mame
    file.write(filename + '|') #gamebase
    file.write('|') #hyperlist
    file.write('|') #goodname
    file.write('|') #nointro
    file.write('|') #tosec
    file.write('|') #redump
    tmp = ''
    if publisher is not None:
        tmp = publisher.text

    file.write(tmp +'|') #publisher
    
    tmp = ''
    if developer is not None:
        tmp = developer.text

    file.write(tmp+'|') #publisher
    file.write('|') #developercloneof

    tmp = ''
    if releasedate is not None and releasedate.text is not None:
        tmp = releasedate.text

    if tmp != '':
        year = tmp[0:4]
        month = tmp[4:6]
        day = tmp[6:8]
        file.write(year+'-'+month+'-'+day+'|')
    else:
        file.write('|')#date


    file.write('|')#esrb

    tmp = ''
    if genre is not None and genre.text is not None:
        tmp=genre.text
    file.write(tmp+'|')

    file.write(rating.text+'|')
    #file.write('tating.text|')

    file.write('|') #score
    file.write('|') #numplay

    file.write('|') #flags
    file.write('|') 
    file.write('|') 
    file.write('|') 
    file.write('|') 
    file.write('|') #flags

    tmp = ''
    if desc is not None and desc.text is not None:
        tmp=desc.text
    file.write('~' + tmp+'~|') #description

    #file.write('|') #data

   
    file.write('\n')
    a +=1
print("done")

file.close

 

Just another question: is it possible to sort the displayed list of roms by anything else than by name?

Guest
This topic is now closed to further replies.
×
×
  • Create New...