View Single Post
  #1  
Old February 21st, 2001, 10:08 AM

GoatFoot GoatFoot is offline
Private
 
Join Date: Jan 2001
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
GoatFoot is on a distinguished road
Default Manipulating SE IV data files

I don't know if I'm stating the obvious or demonstrating my ignorance, but I've found that sed on cygwin works quite well for modding the various data files in a consistent, controllable, and reproducible fashion.

There may be a bit of a learning curve, but there are plenty are resources on the web if anyone should decide to investigate.

I'd stop reading here, if I were you.


As an example, no chosen quite at random

assuming you've installed cygwin.

To change the Point-Defense research goal from 3 to 5 in all files:

create a text file re3-5.sed
--begin--
# Change Point-Defense research lvl from 3 to 5
/Tech Area Name.*Point-Defense/,/^$/{
/Tech Area Level/s/:= 3/:= 5/
}
--end--

then

back up all your files.

cd <SEIV Dir>/Pictures/Races

for file in `ls */*_AI_Research.txt`; do
sed -f ~/re3-5.sed $file > $file.tmp
mv $file.tmp $file
done

you have just changed every occurence of ":= 3" to ":= 5" that was on a line with "Tech Area Level" and that fell between lines "Tech Area Name... Point_Defense" and a blank line, in every file named <anything>_AI_Research.txt that was in a directory below <SEIV dir>/Pictures/Races.

you can put any number of changes in 1 file, and do them all at once.


I've been up way to long.

[This message has been edited by GoatFoot (edited 21 February 2001).]
Reply With Quote