All I want is the last two columns printed.
How to print last two columns using awk
awk
Related Topic
- Linux – Using awk to print all columns from the nth to the last
- How to print all the columns after a particular number using awk
- Regex – How to print matched regex pattern using awk
- Swap two columns – awk, sed, python, perl
- Using multiple delimiters in awk
- Perl – how to remove the first two columns in a file using shell (awk, sed, whatever)
- Unix – Get last field using awk substr
Best Answer
You can make use of variable
NF
which is set to the total number of fields in the input record:this assumes that you have at least 2 fields.