How to Reorder columns in delimited file using awk

Here is very useful command line to help you out to nicely reorder columns in delimited file with using awk.

cat mybigfile.txt | awk 'BEGIN{FS="," OFS="|";} {print $1,$2,$4,$5,$6;}' > sourtedoutfile.txt
Effective awk Programming (3rd Edition)
List Price: $44.99
Price: N/A
You Save: N/A

Be the first to comment on "How to Reorder columns in delimited file using awk"

Leave a comment

Your email address will not be published.


*


Get Adobe Flash player Plugin by wpburn.com wordpress themes