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

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