Hello.
> # sample awk file, 1pass [auto-generated from another awk file + tsv
> datafile]
> #
> /^data/ { $0 =
>
gensub(/\<a\s([[:digit:]])\s([[:alpha:]])/,"/address@hidden@address@hidden@\\2","g")
}
> /^data/ { $0 =
>
gensub(/\<b\s([[:digit:]])\s([[:alpha:]])/,"/address@hidden@address@hidden@\\2","g")
}
> /^data/ { $0 =
>
gensub(/\<c\s([[:digit:]])\s([[:alpha:]])/,"/address@hidden@address@hidden@\\2","g")
}
> /^data/ { $0 =
>
gensub(/\<d\s([[:digit:]])\s([[:alpha:]])/,"/address@hidden@address@hidden@\\2","g")
}
> /^data/ { $0 =
>
gensub(/\<e\s([[:digit:]])\s([[:alpha:]])/,"/address@hidden@address@hidden@\\2","g")
}
>
> # ..(2295 more) !!!
It looks like rewriting this to a single rule:
/^data/ { $0 =
gensub(/\<(.)\s([[:digit:]])\s([[:alpha:]])/,"/address@hidden@address@hidden@\\3","g") }
would save you considerable time; it would not suprise me if most of
the time was going into testing for a match and failing to find it.
In addition if you have lots of other tests where once you've made the
substitution and you know you're done, doing something like
/^data/ {
$0 =
gensub(/\<(.)\s([[:digit:]])\s([[:alpha:]])/,"/address@hidden@address@hidden@\\3","g")
print
next
}
would save even more time.
Hope this helps,
Arnold