gawk script to print the last field of each line:
gawk -F <delimiter> "{ print $NF }".
-F defines the separator in the command line, otherwise you would prepend "BEGIN { FS=<delimiter> }"
.
NF is the number of fields in a line and $n is the value of the n'th field, so $NF
outputs the last field.
Thanks for the tip!
ReplyDelete