2 ms·
> awk '{print $2,$4;}' is useful and easy to remember. $NF refers to the last field. FS is the variable to override the default field separator of white space.
by masklinn 8y ago
> awk '{print $2,$4;}' is useful and easy to remember. $NF refers to the last field. FS is the variable to override the default field separator of white space. Here's an example of it's use. OFS is the output field separator.
Yeah also cut is just inconvenient, awk works much better when working with the usual tabulated data.
> Works on CSV files too with the right field separator.
You're probably better off using xsv though.