21.07.2015 Views

GAWK: Effective AWK Programming

GAWK: Effective AWK Programming

GAWK: Effective AWK Programming

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

200 <strong>G<strong>AWK</strong></strong>: <strong>Effective</strong> <strong>AWK</strong> <strong>Programming</strong>in Section 12.3.1 [Noting Data File Boundaries], page 197, the following library file calls afunction named zerofile that the user must provide. The arguments passed are the filename and the position in ARGV where it was found:# zerofile.awk --- library file to process empty input filesBEGIN { Argind = 0 }ARGIND > Argind + 1 {for (Argind++; Argind < ARGIND; Argind++)zerofile(ARGV[Argind], Argind)}ARGIND != Argind { Argind = ARGIND }END {if (ARGIND > Argind)for (Argind++; Argind

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!