
https://www.gnu.org/software/gawk/manual/gawk.html
The manpage alone is quite useful, though lacks some useful details.
The awk FAQ provides general background, including diffeerences between implementations:
The GNU Awk User's Guide[1] is amazingly detailed, but the new AWK has bloated a lot, has 1000 features where the older one had a few dozen, and those core ones should be learnt first. (But people still like programming with it, and kept asking for features..) Hmm I don't think I use any of the new features, maybe I should...
But really, it's very simple, I can't thinking of anything that's been anything like as easy to learn, except maybe BASIC. With which AWK shares some similarities - the friendliness of it, the BEGIN and END..
[1] http://www.gnu.org/software/gawk/manual/gawk.html
[0] Or if there are too many, get names from lists of best books on a subject.
https://www.gnu.org/software/gawk/manual/gawk.html
It's a pretty good book which teaches you both techniques and the nitty-gritty. I recommend this.
See:
https://news.ycombinator.com/item?id=22156456
In the GNU Awk User's Guide:
https://www.gnu.org/software/gawk/manual/html_node/Multiple-...
Tracking column and field widths across page breaks is ... interesting, but more tractable.
BEGIN {
RS=""
FS="\n"
}
{
for( i=1; i<=NF; i++ ) {
nfields = split($i, afields, ": ")
if( nfields != 2 ) {printf( "Bad fields count: %s %s %s\n", NR, i, $i) | "/dev/stderr"; exit 1 )}
field(afield[1]) = afield[2]
}
}
(Untested, but should be generally accurate.)That parses records based on blank lines, into fields based on lines, splitting the fields into individual data recoreds based on ": " as a regex.
For more, see the GNU Awk User's Guide:
https://www.gnu.org/software/gawk/manual/html_node/Multiple-...