I have a file in following format. I need to sort it by largest code first and then by largest values column.
colour,letter,code,value
red,r,016,949.8
red,r,015,603.9
red,r,014,348.4
blue,b,016,362.29
blue,b,015,460.2
blue,b,014,9850.9
output:
red,r,016,949.8
blue,b,016,362.29
red,r,015,603.9
blue,b,015,460.2
blue,b,014,9850.9
red,r,014,348.4
my implementation
sort -k3,3n -r -k4,4n -t \t data.csv
When I try to do it it sorts the file but doesn't sort the first two columns.