Thursday, 9 December 2010

AWK - get last field

When I generate output from my programs, it is frequently accompanied with some textual information. For example, an output line could read as
Total time: 1234.5
Avoiding tedious copying and pasting, a simple awk command can get the last field from the lines:
awk '{ print $NF }'

No comments:

Post a Comment