I cannot fix a problem with a text file since I am a beginner with linux command and/or bash script.
I have a text file like this:
object1 10.603 0.757
object1 10.523 0.752
object1 10.523 0.752
object1 10.456 0.747
object1 10.456 0.747
object1 10.271 0.734
object2 11.473 0.194
object2 11.460 0.194
object2 11.445 0.191
object2 11.421 0.190
object3 9.272 0.12
object3 9.236 0.12
object3 8.814 0.119
object3 0.968 0.119
object3 10.959 0.119
and i have to do on this file a particular operation of cutting and sorting: for every string that contains the words "object1", "object2" and so on, i want to print only the string having the highest values according to the third column; then i want to sort the output of this operation according to the values of the third column.
The output, for sake of clarity, should be like this:
object1 10.603 0.757
object2 11.473 0.194
object3 9.272 0.12
Any suggestion for the linux command to be used and/or a bash script?
thanks to everyone