Ah, so it's totalling them...
Sounds like a awk or
perl solution would be the way to go.
You can then pipe the ouput through sort to get whatever order you want. You've already got the sort right (without the -u of course) so I'll focus on the totaling part...
As I'm not great with awk, I'll try
perl, I'm sure one of the awk wizzes around here can offer up a solution for that
Code:
#!/bin/perl -w
while (<>) {
($name,$left,$right)=split(/\+/);
$vals{$name}{"left"}+=$left;
$vals{$name}{"right"}+=$right;
}
foreach $name (keys %vals) {
printf "%s\+%012.3f\+%012.3f\n",${name},$vals{$name}{'left'},$vals{$name}{'right'};
}