awk to remove first 3 lines and print remaining $1, $2 fields
How would I use awk to remove the first few lines while printing the fields on the remaining lines?
e.g. Input data.in: Header: This line is useless Header2: This line is useless Header3: This line is useless John 24 32 Jane 21 33 Desired Output: John 32 Jane 33 Current Script: cat data.in | awk '{ if (FNR > 3) printf("%s %s\n", $1, $3) } [NEVERMIND, got it.] |
It's always nice to share your success!
At any rate, you don't need to use cat... Code:
awk '{ if (FNR > 3) printf("%s %s\n", $1, $3) }' data.in |
All times are GMT -5. The time now is 10:37 AM. |