Ego-X
08-10-2008, 04:08 PM
After spending a few days creating a game list for HyperSpin I decided there had to be a smarter way than filling out the fields manually.
Here is the result!
You will need Notepad++ to perform these operations.
You will need also need a clrmamepro no-intro gamelist for the system you are creating a list for.
find field and replace field are both references don't type field anywhere, probably obvious but...
Lets get going!
Open the Clrmamepro no-intro gamelist in notepad++
Delete the whole of the header.
CTRL+H to bring up replace dialog.
strip the close tags out(the parentheses at the start of the line)
find field ^\)
replace field leave blank
Delete parentheses at line beginnings($ indicates EOL this elliminates any possibility of inadvertantly removing parentheses we need
find field game \($
replace field blank
Insert the opening game tags
Find field name "
replace field <game name="
Close the tag
find field <(.+)$
replace field <\1>
Put <> around the word beginning
requires extended radio button selected
find \tdescription
replace \t<description>
Find the line with beginning on and add the closing tag </beginning>
<([^>]+)>(.+)$
<\1>\2</\1>
Remove extra rom information from game description
find field (USA, Europe)"</description>
replace field </description>
find field (USA)"</description>
replace field </description>
find field (Europe)"</description>
replace field </description>
find field (world)"</description>
replace field </description>
add extra fields used by HS
find field </description>
replace field </description>\n\t<crc></crc>\n\t<manufacturer></manufacturer>\n\t<year></year>\n\t<genre></genre>
Ditch the line with the crc, md5 etc for now put the closing game tag here
find ^.*crc.*$
replace 4 spaces </game>
Close replace
Add the menu tags to top and bottom of list
You know have a HS gamelist with minimal functionality for now!
I've tested the resulting in HyperSpin works perfectly there are no guarantees my documentation does though :D
Figure there is still room to condence the operations much further by combining actions.
Still beats typing out a thousand game details by hand!
Here is the result!
You will need Notepad++ to perform these operations.
You will need also need a clrmamepro no-intro gamelist for the system you are creating a list for.
find field and replace field are both references don't type field anywhere, probably obvious but...
Lets get going!
Open the Clrmamepro no-intro gamelist in notepad++
Delete the whole of the header.
CTRL+H to bring up replace dialog.
strip the close tags out(the parentheses at the start of the line)
find field ^\)
replace field leave blank
Delete parentheses at line beginnings($ indicates EOL this elliminates any possibility of inadvertantly removing parentheses we need
find field game \($
replace field blank
Insert the opening game tags
Find field name "
replace field <game name="
Close the tag
find field <(.+)$
replace field <\1>
Put <> around the word beginning
requires extended radio button selected
find \tdescription
replace \t<description>
Find the line with beginning on and add the closing tag </beginning>
<([^>]+)>(.+)$
<\1>\2</\1>
Remove extra rom information from game description
find field (USA, Europe)"</description>
replace field </description>
find field (USA)"</description>
replace field </description>
find field (Europe)"</description>
replace field </description>
find field (world)"</description>
replace field </description>
add extra fields used by HS
find field </description>
replace field </description>\n\t<crc></crc>\n\t<manufacturer></manufacturer>\n\t<year></year>\n\t<genre></genre>
Ditch the line with the crc, md5 etc for now put the closing game tag here
find ^.*crc.*$
replace 4 spaces </game>
Close replace
Add the menu tags to top and bottom of list
You know have a HS gamelist with minimal functionality for now!
I've tested the resulting in HyperSpin works perfectly there are no guarantees my documentation does though :D
Figure there is still room to condence the operations much further by combining actions.
Still beats typing out a thousand game details by hand!