Hi ,
I have a bunch of files with different # of columns but I want to write a single awk script.
What is the awk symbol for last column? say '{print $lastcol}' or something
Hi ,
I have a bunch of files with different # of columns but I want to write a single awk script.
What is the awk symbol for last column? say '{print $lastcol}' or something
$NF
(too short ...)
That will print all non-empty lines. I think you meant:
{ print $NF }
... that happen to have the last column different than an empty string or 0. I mean:
% printf '%s\t%s\n' a "" b 0 c ok| awk -F\\t \$NF
c ok
Yes, I was responding to this question:
And you're right, I had to be clearer.