I would like to find lines lines with duplicate values in column 1, and retain only one based on two conditions: 1) keep line with highest value in column 3, 2) if column 3 values are equal, retain the line with the highest value in column 4.
Desired output:
I was able to find duplicate lines:
awk 'NR==FNR{a[$1]++;next;}{ if (a[$1] > 1)print;}' file1 file1
But I can't figure out how to go about filtering based on the criteria I just described.