Created
October 2, 2009 20:27
-
-
Save gamefreak/200090 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###################################################################### | |
#Copy this into your ares-data/derived/ directory as meatgrinder.sed # | |
###################################################################### | |
:a | |
N | |
$!ba | |
s/\n/,/g | |
s|^<\?.*\?>||g | |
s|^,||g | |
s|<\([a-z\-]*\)>|\1 = {|g | |
s|</[a-z\-]*>|}|g | |
s|<\([a-z\-]*\) integer=\"\(-*[0-9]*\)\"/>|\1 = \2|g | |
s|<\([a-z\-]*\) real=\"\(-*[0-9\.]*\)\"/>|\1 = \2|g | |
s|<\([a-z\-]*\) string=\"\([^\"]*\)\"/>|\1 = \"\2\"|g | |
s|<\([a-z\-]*\)/>|\1 = true|g | |
s|<\([a-z\-]*\)\ |\1 = {\ | |
|g | |
s|\([a-z\-]*=\"[^\"]*\"\)\ |\1,|g | |
s|/>,|}|g | |
s|>,|,|g | |
s|[\ ]\{2,\}||g | |
s|}|},|g | |
s|,\{1,\}|,|g | |
s|,}|}|g | |
s|{,|{|g | |
s|\-\([^0-9]\)|_\1|g | |
s|,|,\ | |
|g | |
s|weapon |weapon1 | | |
s|weapon |weapon2 | | |
s|weapon |weapon3 | | |
s|position\ =\ ||g | |
####################################################################### | |
#Then navigate to the ares-data/derived/Objects directory and run this# | |
# # | |
#replace $FILE with the file you want to convert. # | |
####################################################################### | |
< $FILE sed -f ../meatgrinder.sed | tr '\n' ' ' | sed -e 's|,[^,]*$||' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment