I have a file with this record
myFile.txt :
firstname lastname note
Ben Quick 12
Fred Free 10
Mark Marked 18
Mark Marked 20
Ben Quick 8
and want to print every unique person with his maximum note
the result will be like this
firstname lastname maxNote
Ben Quick 12
Fred Free 10
Mark Marked 20
so I have this awk script
#!/bin/awk -f
BEGIN {
print "firstname lastname maxNote"
}
NR > 1 {
list[$1," ",$2]++
}
END {
for(l in list)
print l
}
it print only unique firstname + lastname
my question is : how can I sort them by note and print the whole line of each ?
your help is appreciated !