range.prep (300B)
1 awk ' # range.prep 2 # Input: ["%begin"|"%end"|""] string (tab) number 3 # Output: string (tab) ["b"|"e"|"a"] (tab) number 4 5 BEGIN { FS = OFS = "\t" } 6 { f2 = "a" } 7 $1 ~ /^%begin/ { f2 = "b"; sub(/^%begin */, "", $1) } 8 $1 ~ /^%end/ { f2 = "e"; sub(/^%end */, "", $1) } 9 { print $1, f2, $2 } 10 ' $*