aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/index/range.prep
blob: 16ae3cc83585ebe6cbd619fe8a4747e6b6652d9d (plain)
1
2
3
4
5
6
7
8
9
10
awk ' # range.prep
#   Input:  ["%begin"|"%end"|""] string (tab) number
#   Output: string (tab) ["b"|"e"|"a"]  (tab) number

BEGIN		{ FS = OFS = "\t" }
		{ f2 = "a" }
$1 ~ /^%begin/	{ f2 = "b"; sub(/^%begin */, "", $1) }
$1 ~ /^%end/	{ f2 = "e"; sub(/^%end */, "", $1) }
		{ print $1, f2, $2 }
' $*