I have this file on Linux:
14:00:01.071 5255 604177
4 14:00:01.074 4608 1415742
14:00:01.074 18398 1122001
2 14:00:01.074 11723 155575
5 14:00:01.075 4695 885808
Desired Output:
14:00:01.071 5255 604177
14:00:01.074 4608 1415742
14:00:01.074 18398 1122001
14:00:01.074 11723 155575
14:00:01.075 4695 885808
Command Used:
gawk '{ print $NF-1, $NF}' filename
But it prints only the last two columns.
NF-1
) and 2) assuming you do have a script to print the last column withNF
and the 2nd-last column withNF-1
, I struggle to believe you couldn't figure out how to build on that pattern to also print the 3rd-last column.