PDA

View Full Version : .XML File Editing/Sorting?



DR9
09-22-2011, 11:32 AM
Hello,

I have made my console lists by the following method:

Picking each genre I want and cut n pasting that whole genre list into a single big .XML file. This made it easier then hunting and pecking the original full gamesytem.xml file.

What I would like to know since the .XML I created is like this:

<menu>
Action games A-Z
RPG games A-Z
Shooters A-Z
</menu>

This is a short snippet of my Nintendo.xml

now looks like


<game name="Zen - Intergalactic Ninja (USA)" index="" image="z">
<description>Zen - Intergalactic Ninja (USA)</description>
<cloneof></cloneof>
<crc>D8578BFD</crc>
<manufacturer>Konami</manufacturer>
<year>1993</year>
<genre>Platform</genre>
<rating>HSRS - GA (General Audience)</rating>
<enabled>Yes</enabled>
</game>
<game name="Advanced Dungeons &amp; Dragons - DragonStrike (USA)" index="" image="">
<description>Advanced Dungeons &amp; Dragons - DragonStrike (USA)</description>
<cloneof></cloneof>
<crc>2C5908A7</crc>
<manufacturer>Pony Canyon</manufacturer>
<year>1992</year>
<genre>Role-Playing</genre>
<rating>HSRS - GA (General Audience)</rating>
<enabled>Yes</enabled>
</game>


Want to look like


<game name="Advanced Dungeons &amp; Dragons - DragonStrike (USA)" index="" image="">
<description>Advanced Dungeons &amp; Dragons - DragonStrike (USA)</description>
<cloneof></cloneof>
<crc>2C5908A7</crc>
<manufacturer>Pony Canyon</manufacturer>
<year>1992</year>
<genre>Role-Playing</genre>
<rating>HSRS - GA (General Audience)</rating>
<enabled>Yes</enabled>
</game>
<game name="Zen - Intergalactic Ninja (USA)" index="" image="z">
<description>Zen - Intergalactic Ninja (USA)</description>
<cloneof></cloneof>
<crc>D8578BFD</crc>
<manufacturer>Konami</manufacturer>
<year>1993</year>
<genre>Platform</genre>
<rating>HSRS - GA (General Audience)</rating>
<enabled>Yes</enabled>
</game>


How can I sort all the <game name="GAMENAME
by alphabetical order and then resave the file. So in the end I have a full list of games from A-Z and I can re-index the games properly vs having all the games in a random order.

Note this is for the .XML file only, I'm not referring to the HS option where I can turn it on to auto sort.

Thanks!

blur
09-22-2011, 01:44 PM
Open xml with excel - sort it and save again as xml.

DR9
09-22-2011, 02:28 PM
I open the file in 2010 Excel and each line is a game, I sort the game column by AtoZ and it looks right in Excel but I cant save it as .XML data if I do .XML 2003 Excel its all garbage, you have the proper steps?

I open it I get
http://img.photobucket.com/albums/v12/picstore/e1.jpg

then get and click ok
http://img.photobucket.com/albums/v12/picstore/e2.jpg

I sort the column
http://img.photobucket.com/albums/v12/picstore/e4.jpg

got save as book2.xml - error of some type
http://img.photobucket.com/albums/v12/picstore/e5.jpg

blur
09-22-2011, 02:45 PM
you open it as xml table and save it as xml data

not excel 2003 format but xml data

DR9
09-22-2011, 02:49 PM
That is the error I get saving as Excel XML Data.

blur
09-22-2011, 02:57 PM
ups didn't see your edited post

i don't get this error

i'm on office 2003

DR9
09-22-2011, 03:12 PM
It might be different in 2010 vs 2003 but I figured it out, I have to delete the <header>stuff</header> (remove headers completely) so it's not there then open, sort it, and save it. No more error and works when I viewed it in Notepad++ now.

Hopefully this will help someone else out, I would have never though to try Excel and you lead me on the right path, Thanks a bunch!

djvj
09-22-2011, 04:06 PM
Altova XMLSpy is what I use, I think it's way better for xml editing.

dustind900
09-30-2011, 10:14 PM
use this app - http://www.hyperspin-fe.com/forum/showthread.php?t=14002
it sorts the list for you and adds the image letter where necessary.