Linux *or* windows or linux *and* windows?
I've touched this up for legibility. First, copy these scripts into textfiles (hence, "scriptfile").
Code:
BEGIN{low=ARGV[2]; high=ARGV[3]; mask=ARGV[4]; ARGC-=3;}
{pmode = 1;}
/#terrain/ && ($2 >= low && $2 <= high){print $1 " " $2 " " or($3,mask); pmode = 0;}
(pmode == 1){print;}
usage: awk -f <scriptfile> <mapfilename> <min> <max> <mask>
ex: awk -f makemask.awk 390_mp.map 1 12 1
The output will be a version of 390_mp.map where provinces 1-12 are now large.
You can use this to set any province mask you want on any range of provinces you want - I forget what the bitmask is for nostarts but you can use this to add ocean, for example.
If you want to strip out a bitmask, use this:
Code:
BEGIN{low=ARGV[2]; high=ARGV[3]; mask=ARGV[4]; ARGC-=3;}
{pmode = 1;}
/#terrain/ && ($2 >= low && $2 <= high){print $1 " " $2 " " and($3,compl(mask)); pmode = 0;}
(pmode == 1){print;}
Identical usage.