View Single Post
Old 03-14-2005, 08:24 AM   #5
lcalabrese
A Hill Giant
 
Join Date: Jan 2005
Server: The Seventh Hammer
Posts: 35
Interface Author - Click to view interfaces
Post A script to make your lives easier

Ok, it's a little screwy because of some restrictions on the DOS/Windows platform, but here it is. Note that you will need the GnuWin32 Sed Package (or another sed package) installed on your system and in your search path environment variable (%PATH%) in order for this to work.

Place the attached two files into your custom UI directory. Run fixall.bat to update all xml files. It changes True->true and False->false.

fixall.bat contents:
Code:
for %%a in ("*.xml") do fixone.bat %%a

fixone.bat contents:
Code:
copy %* fixit.xml /Y sed -e "s/True/true/" -e "s/False/false/" fixit.xml >%* del fixit.xml /Q


Note: If you just want to fix one xml file, you can run fixone.bat <filename>.

Technical note: This script loops for all files named *.xml in the current directory, copies each in turn to a file called "fixit.xml", and pushes that file through sed back to the original file. Then it deletes the "fixit.xml" file it created.
Attached Files
File Type: zip fix-xml.zip (319 Bytes, 3 views)
lcalabrese is offline   Reply With Quote