# dem2ann.awk - (c) Diane Larin, INRO Consultants Inc. # 1.3 2004/06/22 16:59:35 # # The right to use this AWK script is granted to all EMME/2 or STAN users, # provided the following conditions are met: # 1) The script cannot be sold for a fee (but it can be used and distributed # within consulting projects). # 2) The user is aware that this script is not a part of the EMME/2 or STAN # software licence and there is no explicit or implied warranty or # support provided with this script. # 3) The comments in this script must not be removed and any addition or # modification must be appropriately identified as such and give at least # date, name and the reason of the modification. # # This AWK script takes an EMME/2 demarcation file (d141.in) and # translates it into an annotation file. # # usage: awk -f dem2ann.awk d141.in > annotx # # Notes: # 1) For "linear" and "spline" demarcations, symbols are replaced by # line patterns. # The initialization of the symbol array (see symbol[X] below) # may be modified to reflect one's needs. # 2) For "point" demarcations, symbols are replaced by a character string. # The initialization of the string array (see text[X] below) # may be modified to reflect one's needs. # 3) The attributes "size" and "space" are ignored. # BEGIN { # initialization of symbol array (line pattern) # for "linear" and "spline" demarcations symbol[1]=1 #solid symbol[2]=2 #dotted symbol[3]=3 #dot-dash symbol[4]=4 #short dash symbol[5]=5 #long dash symbol[6]=1 #solid symbol[7]=2 #dotted symbol[8]=3 #dot-dash symbol[9]=4 #short dash # initialization of string array # for "point" demarcations text[0]="" text[1]="-" text[2]="=" text[3]="+" text[4]="x" text[5]=">" text[6]="[]" text[7]="<>" text[8]="|>" text[9]="V" } $1=="t" { next } /set/ { printf("u1 / %s\n", $0) next } $1=="symbol" { printf("c %d\n", $8) t=text[0] if ($10=="linear") { printf("l %d\n", symbol[$2]) printf("m") cmd="d" } if ($10=="spline") { printf("l %d\n", symbol[$2]) printf("m") cmd="j" } if ($10=="point") { printf("t") cmd="t" t=text[$2] } new=1 next } NF>0 { for(l=1; l