James,
I like it. I wrote myself the following little ditty to bust
the gensec output into subsectors, assuming that mapsub likes 8x10
sector, as best I can tell. (Since the traveller I play is even more
non-standard than yours, I don't know how big they are supposed to be!)
BILL
#
# subsec.csh [-v] x y [filename...]
#
# -v option causes it to print the patterns it would use and exit.
#
# any extra args are used as filenames by EGREP instead of the standard
# input.
#
# legal values of x and y are 1 2 3 and 4 .
#
# picks only those lines in GENSEC format which are within the (x,y)th
# subsector, where 0101 is in the (1,1)th and 3240 is in the (4,4)th,
# with 0840 in the (1,4)th and 3210 in the (4,1)th.
#
# designed for use as:
# : sh shell script
# gensec > sector.$n
# for x in 1 2 3 4 ; do
# for y in 1 2 3 4 ; do
# subsec.csh $x $y sector.$n > map.$n.$x$y
# done ; done
#
# egrep patterns for 01-08, 09-16, 17-24, 25-32.
set x=("0[1-8]" "09|1[0-6]" "1[7-9]|2[0-4]" "2[5-9]|3[0-2]")
#
# egrep patterns for 01-10, 11-20, 21-30, 31-40.
set y=("0[1-9]|10" "1[1-9]|20" "2[1-9]|30" "3[1-9]|40")
#
if ($1 == "-v" ) then
echo "$x[$2] $y[$3]"
else
egrep "^($x[$1])($y[$2])" $argv[3-]
endif
- --------------------
Did I send you my AWK program to translate GENSEC format into moderately
readable pseudoEnglish?