4 ms·
You can name fields in awk so that you don't have to refer to them numerically as $8, $13 or whatever. Example: BEGIN { first=1; second=2; third=3 } $f
by kazinator 11y ago
You can name fields in awk so that you don't have to refer to them numerically as $8, $13 or whatever. Example:
BEGIN { first=1; second=2; third=3 }
$first > 42 { print $third }
Here, $first means $ applied to the variable first. Since first evaluates to 1, it means $1.
Broken CSV handling that doesn't respect quotes is easily done in awk using comma as the field separator.
- cben 11y agoWhat about non-broken CSV? Is there an easy way to tell awk to skip escaped or quoted delimeters?