awk: keep records with the highest value that share a field, while ignoring other fields
问题 Imagine that you want to keep the records with the highest value in a given field of a table, just comparing within the categories defined by another field (and ignoring the contents of the others). So, given the input nye.txt: X A 10.00 X A 1.50 X B 0.01 X B 4.00 Y C 1.00 Y C 2.43 You'd expect this output: X A 10.00 Y C 2.43 This is an offshot of this previous, related thread: awk: keep records with the highest value, comparing those that share other fields I already have a solution (see