Jump to content
Peliculon

xml description in alphabetical order

Recommended Posts

Hi, im editing xml list for MAME 0.139 and im seeing that there is an alphabetical order, but what happens is that is not an exact order :rofl:

Im asking me if someone knows about a program that can handle that, i mean, reorder the blocks in the xml by alphabetical order by a determinated tag/label (in this case description label). In the next example we will see that the game mgakuen2 should be place before than the game mgcldate (because the description tag/label is the real alphabetical order for this case):

<?xml version="1.0"?>
<menu>
    <game name="88games" index="true" image="'">
        <description>&apos;88 Games</description>
        <cloneof></cloneof>
        <crc></crc>
        <manufacturer>Konami</manufacturer>
        <year>1988</year>
        <genre>Sports / Track &amp; Field</genre>
        <rating>AAMA - Green (Suitable For All Ages)</rating>
        <enabled>Yes</enabled>
    </game>

    <game name="005" index="true" image="0">
        <description>005</description>
        <cloneof></cloneof>
        <crc></crc>
        <manufacturer>Sega</manufacturer>
        <year>1981</year>
        <genre>Maze / Shooter Small</genre>
        <rating>AAMA - Green (Suitable For All Ages)</rating>
        <enabled>Yes</enabled>
    </game>

    <game name="a51mxr3k" index="true" image="a">
    <description>Area 51 / Maximum Force Duo (R3000)</description>
        <cloneof>area51mx</cloneof>
        <crc></crc>
        <manufacturer>Atari Games</manufacturer>
        <year>1998</year>
        <genre>Shooter / Gun</genre>
        <rating>AAMA - Red (Animated Violence Strong)</rating>
        <enabled>Yes</enabled>
    </game>

    <game name="mgakuen2" index="" image="">
    <description>Mahjong Gakuen 2 Gakuen-chou no Fukushuu</description>
        <cloneof></cloneof>
        <crc></crc>
        <manufacturer>Face</manufacturer>
        <year>1989</year>
        <genre>Tabletop / Mahjong * Mature *</genre>
        <rating>AAMA - Red (Sexual Content Strong)</rating>
        <enabled>Yes</enabled>
    </game>

<game name="mgcldate" index="" image="">
    <description>Magical Date / Magical Date - dokidoki kokuhaku daisakusen (Ver 2.02J)</description>
        <cloneof>mgcldtex</cloneof>
        <crc></crc>
        <manufacturer>Taito</manufacturer>
        <year>1996</year>
        <genre>Multiplay / Mini-Games</genre>
        <rating>AAMA - Green (Suitable For All Ages)</rating>
        <enabled>Yes</enabled>
    </game>

</menu>

 

The MAME xml list that im creating have a lots of this alphabetical "errors" that can't be handle in an easy way (because in the xml are +7000 games). So im hope that someone here knows a program that can handle that. If not, i will put here somes ideas for create this program (i think that create this program should be easy, but i don't know program):

1.- Check all blocks in a determinate xml file (a block for me is from here <game name="unknown" index="" image=""> ... to here </game>).

2.- Once that the program check all the blocks in the xml, then is needed reorganize them by alphabetical order according to the description tag/label inside each block.

3.- Export the new xml and thats all.

 

So finally, I don't know if this program exist. If someone knows about a program that can make this, please, say me.

 

Share this post


Link to post
Share on other sites
On 15/3/2018 at 6:49 PM, dragon57 said:

Microsoft Excel should be able to handle this

I tried with Excell. Is needed a lot of knowledge for import/export xml files. There is not an easy way just for order alphabetically the description tags and export that in a new xml file.

I tried too with OpenOffice (this is worst than with Excell).

I tried too with Don's HyperSpin Tools, i order the roms by description, but when i export the xml list, meh... Still beeing not organized by description, are organized by roms name.

So, i think that i just will create MAME 0.139 xml list (and all the genres xml list for this mame) in this disorganized way.

Is incredible that not exist a simple program that can handle that in an easy and faster way :blink:

Share this post


Link to post
Share on other sites

Let me see if I can come up with something isn't so difficult.

By the way, what version of Excel do you have?

Share this post


Link to post
Share on other sites
17 minutes ago, dragon57 said:

what version of Excel do you have?

Excel 2016 (but expire in a few days, i just install for make the xml list reorganized alphabetically by the description).

Share this post


Link to post
Share on other sites

OK, I was just able to use Excel to sort the MAME.xml file I use and export it. I'll try to write up a procedure below.

First, open Excel to a blank sheet. Look at the ribbon and see if the Developer menu is turned on and visible along with the other standard menus, ie Home, Insert, Page Layout, etc. If it isn't turned on, go to File, Options, Customize Ribbon. (See below) Click on the Developer option, then click on OK.

5aaca48055812_Excel01.PNG.b8b035988e0216efc9ca34cef5ed6844.PNG

Next, you want to open the MAME.xml file using the standard Excel file selector. When Excel tries to open the file, the following panel should pop-up. Make sure you choose the third option like the pic below shows.

5aaca4f102a6d_Excel02.PNG.11767e9e8f62e4193d3c40c7c178df0f.PNG

You will probably get the following pop-up. Ignore it and click on OK.

5aaca539dba8b_Excel03.PNG.7aef55166317a5cf65c157b3bd31f3f9.PNG

Excel should now display the XML Source panel on the far right of an empty sheet. See pic below. Right click on the 'header' folder so header and all the fields below it are highlighted. See pic below.

5aaca58b723c9_Excel04.PNG.346657cb3660d1707828091691b2b46e.PNG

A menu will pop-up showing a 'Map element...' option. Select it and the following should pop-up. Click on OK.

5aaca6b73424c_Excel06.PNG.c4a02513c9bb0c56cb05b56ec2912664.PNG

Go to the bottom of the default sheet and click the + button to add another sheet to the Workbook. Activate the new sheet. Go back and right-click on the 'game' folder, select it, and the following should pop-up. Click on OK.

5aaca70bd74a6_Excel08.PNG.3ca3de3352e932069469e9a9e09fb4dd.PNG

Go to the Developer menu, then click on the 'Import' option. Select the same MAME.xml file again. Excel should now import all the data it needs to fully define your XML schema and data.

You can now sort on any field (description, I think you said), then go to the Developer 'Export' option to write out a new file.

  • Like 1
  • Super Like 2

Share this post


Link to post
Share on other sites
37 minutes ago, dragon57 said:

OK, I was just able to use Excel to sort the MAME.xml file I use and export it. I'll try to write up a procedure below.

[...]

Oh men, this works, thanks a lot! :good:

The only thing different that happens is the exported xml file is that dissapear the..  "index="" image=""> in the roms that have this fields empty. I dont know if this will be a problem, but thats can be fixed easy with a text editor.

Thanks again, you saved me a lot of time YEAHHH :D

Share this post


Link to post
Share on other sites

Yeah, sorry. I forgot to mention Excel doesn't export fields that are blank. I don't think it matters, but unfortunately my arcade is down and I can't verify this. Give it a go before you try to edit it and report back here so others will know.

Share this post


Link to post
Share on other sites
34 minutes ago, dragon57 said:

Yeah, sorry. I forgot to mention Excel doesn't export fields that are blank. I don't think it matters, but unfortunately my arcade is down and I can't verify this. Give it a go before you try to edit it and report back here so others will know.

Yes, this matters. For example, when i finally export the xml list with Excell, and i put the xml list in their corresponding folders of Database, when i run HyperSpin and i tried to acces to the MAME wheel, there was only a black screen. This can be fixed if you put "index="" image=""> " to all the roms again.

But i finded too that how you said, Excel doesn't export fields that are blank (like this for example: "<crc></crc"), excel just erase them. So, i didn't try yet, but the solution is really simple and will works.

Before than open the xml file to reorganize it alphabetically with Excel, i will make a copy of the file in my Desktop. Then i will open this copy with an text editor like SublimeText2, Notepad++, etc. Next step, with the text editor i will replace all the fields that Excel can take like empty and i'll put inside some text, for example:

I will replace this:

<crc></crc>

By this:

<crc>GiveMeAlphabeticalOrder</crc>

:rofl:

 

And i will do the same with every field that can be empty for Excell. Once finished, then i'll load the xml to Excel and export. And after that, i will edit the xml file again with a text editor for replace the fields that i filled with "GiveMeAlphabeticalOrder".

Share this post


Link to post
Share on other sites
On 3/17/2018 at 6:31 AM, dragon57 said:

OK, I was just able to use Excel to sort the MAME.xml file I use and export it. I'll try to write up a procedure below.

First, open Excel to a blank sheet. Look at the ribbon and see if the Developer menu is turned on and visible along with the other standard menus, ie Home, Insert, Page Layout, etc. If it isn't turned on, go to File, Options, Customize Ribbon. (See below) Click on the Developer option, then click on OK.

5aaca48055812_Excel01.PNG.b8b035988e0216efc9ca34cef5ed6844.PNG

Next, you want to open the MAME.xml file using the standard Excel file selector. When Excel tries to open the file, the following panel should pop-up. Make sure you choose the third option like the pic below shows.

5aaca4f102a6d_Excel02.PNG.11767e9e8f62e4193d3c40c7c178df0f.PNG

You will probably get the following pop-up. Ignore it and click on OK.

5aaca539dba8b_Excel03.PNG.7aef55166317a5cf65c157b3bd31f3f9.PNG

Excel should now display the XML Source panel on the far right of an empty sheet. See pic below. Right click on the 'header' folder so header and all the fields below it are highlighted. See pic below.

5aaca58b723c9_Excel04.PNG.346657cb3660d1707828091691b2b46e.PNG

A menu will pop-up showing a 'Map element...' option. Select it and the following should pop-up. Click on OK.

5aaca6b73424c_Excel06.PNG.c4a02513c9bb0c56cb05b56ec2912664.PNG

Go to the bottom of the default sheet and click the + button to add another sheet to the Workbook. Activate the new sheet. Go back and right-click on the 'game' folder, select it, and the following should pop-up. Click on OK.

5aaca70bd74a6_Excel08.PNG.3ca3de3352e932069469e9a9e09fb4dd.PNG

Go to the Developer menu, then click on the 'Import' option. Select the same MAME.xml file again. Excel should now import all the data it needs to fully define your XML schema and data.

You can now sort on any field (description, I think you said), then go to the Developer 'Export' option to write out a new file.

Hi, sorry to revive this topic but want to thanks to dragon57 whi gave me the opportunity to sort my mame xml by description with ease.

the excel tutorial is marvelous thanks

regards

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Similar Content

    • By ghostbones
      Hello all, 
      Can anyone help me and point me in the right direction where I might be able to download myself an up to date
      Commodore Amiga XML that is populated with the year, genre etc, of each game? I have tried Hyperlist and many other sites but I can't seem
      to find anything. Many thanks in advance!
    • By croserII
      Some of stuff you can do
      create hyperspin or nointro dat from rom folder
      create mamlist.xml from rom folder
      copy roms listed in nointro or any supported xml\dat\xml format to desired rom folder
      rename your roms from any supported xml\dat\txt file and copy them to desired folder
      merge two supported xml\dat\txt file even info will be merged
      copy rom media file with game list from compatible xml\dat\txt
      much more
      compatible format are
      nonintrodat.dat (parent\clone xml) or standard 
      gamelist.xml
      hyperspin.xml(there is custom one,you can generate one as hyperspin_retrofe.xml)
      retrofe_include.txt (simple txt file with rom names)
      mameinfo.dat (only works in extract function)
      mamehistory.dat (only works in extract function)
      mamelist.xml

      So What is this?
      convert from compatible xml\txt\dat game database format to xml\txt\dat game database,
      extract story files from gamelist.xml mamhistory.dat or mameinfo.dat
      combine or merge two compatible xml\txt\dat and get one file with updated games and info
      copy rom listed in compatible xml\dat\txt from source rom folder to desired folder\rename and crc32 supported,crc32 work with zip and none zip files
      scan and create xml\dat\txt from your roms folder,crc32 supported,crc32 work with zip and none zip files 

      Requirement:
      Tested on windows 10 x64,should run on any windows +7 os (might run on win xp but not tested) 
      you 'll need at least one xml\txt\dat compatible file,check below in Note section
      How to use
      Simply choose the function from drop menu,click on input\output buttons,choose file type from filter drop menu in openfiledialog window,remember always provide the right file type,hyperspin need hyperspin file,nointro.dat need nointro dat file .......
      click doi it
      combine function explained:
      this tool is created to merge info from compatible xml dat xml database format.xml based on name or crc tag,the result is xml\txt\dat file with updated info added roms name and info from both file
      Associate function explained:
       associate function,input1 button should be any compatible xml\txt\dat,mediaroot should be the root folder of your rom media,example: nes media folder contain folders like snaps,title,manual,video snaps ... etc,this function will copy these media according to the name(or crc) in input1 source file
      Some Tips:
      Combine Nointro.dat+gamelist.xml=>resultfile saved as hyperspin_retrofe.xml
      combine resultfile.xml+hyperspin.xml with rating tag=>final_result.xml saved as hyperspin_retrofe.xml
      put the final_result.xml in RetroFE\meta\hyperlist rename it to your prefered system,make sure the name is matching the collection name in retrofe collectio dir
      delete meta.db from retrofe dir
      launch retrofe and have fun 
      ]NOTE:
      Important don't choose the wrong file always feed the right one check compatible file format above for more info
      the combine function priorties the info from input1 button when using crc as comparation,that means if you have the same game but the name in the first is different from the second input file,the first will be considered
      how to get gamelist.xml
      use scraper to get gamelist.xml for your prefered system(mame,sega,snes...) can be found https://github.com/retropie/retropie-setup/wiki/scraper
      put scraper inside your roms folder,ru cmd or use bat(recommended) put these commands:
       
      scraper.exe -add_not_found -console_src="gdb" -use_filename=true -download_images=false -no_thumb 
      PAUSE
       now copy the generated gamelist.xml file from your rom folder to the program folder

      Contacts:
      http://emulator-organizer-f.forumotion.com/
      https://www.facebook.com/Emulators-Organizer/
      https://www.youtube.com/watch?v=Ty6F9RyhFdg
      done 
      enjoy
      Best regard Croser

    • By retrokid192
      Hey Guys,
      I'm rather new to Hyperspin but I have been sucessful in adding systems and roms for the most part. I have run into a problem recently in regards to database xml files. So when I'm on the homescreen where the consoles are on the wheel, when I click a certain console it will not load. I click and it goes black for  quick second and returns to the homescreen. Thats in indication that the database is present but it will not load the game list for some reason. I have the database xml in the appropriate folder as well as the roms, media and emulators installed. Still no sucess in loading the Playstation or Dreamcast consoles. 
      On another note there are instances where I'm able to click the colsole and it loads a few games on the list but not all. I have the roms installed in the appropriate folder but hyperspin is only displaying a few on the list. The database xml that is for the console has all the games listed but when I open the colsole in hypersin the list of games is limited to a few. 
      If someone has had a similar issue or could give assistance it would greatly be appreciated. 
×
×
  • Create New...