I have the following data:
AD12 Ar.1 352 AD12 Ar.7 495 AD12 Ar.8 491 AD12 Ar.6 495 AD12 Ar.5 495 AD12 Ar.9 491 AD13 Ar2.1 495
I want to select the rows with the highest value based on the third column for the unique ids in the first column, but maintain the duplicates for the highest value for each id in the first column, for example:
AD12 Ar.7 495 AD12 Ar.6 495 AD12 Ar.5 495 AD13 Ar2.1 495
I am not sure how to do it, I tried different sort commands, for example: sort -r -k3,3 -k1,1, but did not work. Any suggestions?