AWK:  END { statements }

Anthony Mellor
Anthony Mellor used Ask the Experts™
on
Such as what?

END { statements }
The statements are executed once after all input has been read.

What might you do after? AND does this operate on what has been read or is it for use when all that processing has finished?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
IT / Software Engineering Consultant
Top Expert 2016
Commented:
The {END} block can't see the previously read lines, unless you save pieces of data in variables to be referenced later.  

One use would be total lines at the end of a report, or perform some wrap up calculations.  Or perhaps just display some record counters or statistics.

~bp
Anthony MellorChartered Accountant

Author

Commented:
thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial