3 ms·
My favorite Awk reference is this: https://ferd.ca/awk-in-20-minutes.html https://ferd.ca/awk-in-20-minutes.html Also, a handy trick is to combine awk and cut
by geocrasher 7y ago
My favorite Awk reference is this:
https://ferd.ca/awk-in-20-minutes.html https://ferd.ca/awk-in-20-minutes.html
Also, a handy trick is to combine awk and cut. For example I had a log line that had a variable amount of columns just in one field, but immediately after the field was a comma. I cut based on the comma:
cut -d, -f1,2
and then awk'd the last column:
cut -d, -f1,2 | awk '{ print $2" "$5" "$NF }'
So, sometimes awk and cut can help each other.
- ubadair 7y agoI've been procrastinating learning awk for a while now. Thanks for this, I read it and it's just what I needed.