I have a file with dates (formatted YYYY M DD) and their max/min/avg temperature, alongside with the precipitation for each day. The dates are in the first three columns of strings (1900 9 19 for example), and the spacebar character is the delimiter.
I need to sort them by maximum temperature (used the "sort -k 5 -n" command to sort by that column), and now want to show the dates, not the temperature and other data. What can I do to pick only these columns, without removing anything from the original file?
Example (only the last line is real data found in a file):
FIELDS
1 2 3 4 5 6 7 8 9
YYYY M DD AVG MAX MIN ????? ?? ????
1980 1 12 252 360 140 10073 59 2692
awk -F$'\t' '{print $1$2$3}'
– Rinzwind Aug 15 '19 at 15:39