# cent2ann.awk - Diane Larin, INRO Consultants Inc. # 1.4 2004/06/22 16:59:35 # # This AWK script takes an EMME/2 or STAN network file (d211.in) # and generates an annotation file containing only the centroid numbers # or labels. # # usage: gawk -f cent2ann.awk [COL=index] [SIZE=size] [LAB=1] d211.in > annotx # # Default:color=1 # size =4 (hardware unit) # label=0 (centroid number) # BEGIN { if (!LAB) LAB=0; if (!COL) COL=1; if (!SIZE) SIZE=4; } NR==1 {printf("s-%d\nc%d\nu1\n", SIZE, COL)} $1=="a*" { printf("t %g %g ", $3, $4); if (LAB==1 && $8 != "") printf("%s\n", $8) else printf("%g\n", $2) }