awk help
Hi,
i want to retrieve data from 2nd column to last column from a file test.txt , the below command is working, however can we make it more simpler? awk -F '|' '{OFS="|";print $2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' test.txt |
you can simply remove the first part:
awk ' gsub("^[^|]+[|]", "") ' test.txt |
I would have probably just used sed for a simple removal:
Code:
sed 's/[^|]*\|//' test.txt |
Code:
$ awk -F"|" '{OFS="|"; $1=""; print $0}' test.txt |
Thanks a lot to all.. :-) all options are working fine.
|
Please remember to mark as SOLVED once you have a solution.
|
All times are GMT -5. The time now is 05:05 PM. |