Intake file
website1 ip 20 website1 ip 30 website1 ip 10 website2 ip 200 website2 ip 10 website3 ip 150 I need it to sort so that the sum of the 3rd with the associated website will show first with the highest total with the website
website2 has 210 website 3 has 150 website1 has 60
website2 ip 200 website2 ip 10 website3 ip 150 website1 ip 30 website1 ip 20 website1 ip 10 ive tried sort -k3n -k1n but that is not the results i am looking for 230 website2 ip 200
sortsolution.sortcompares on a line-by-line basis but your sorting criteria depends on sorting in groups, then lines.