# This is a (g)awk script # # Scrape out the cell binding graph from a 'wcells' output file # BEGIN { printf "nv:=table([\n" } /=/ { ct=1; i=1; c=index($0,"="); c=substr($0,2,c-1); while (i <= length($0) ) { if ( substr($0,i,1)=="," ) ct++ i++ } printf "%d=%d,\n", c,ct } /Induced/ { printf "NULL]):\ndown:=table([\n" ; state=1 } /^#/ { if ( state == 1 ) { c=split($0,L,"#"); i=3 k=index(L[2],":"); printf "%d=[",substr(L[2],1,k-1) while (i < c ) { printf "%d,",substr(L[i],1,length(L[i])-1) i++ } if ( c > 2 ) { k=index(L[c],"."); printf "%d],\n",substr(L[c],1,k-1) } else printf "],\n" } } /Individ/ { printf "NULL]):\n" ; exit }