perl -F: -wane '$t{$F[0]}+=$F[2]; $c{$F[0]}++; END{printf "%s: %f\n", $_, $t{$_}/$c{$_} for keys %c}' file [download]
In reply to Re: Average calculation by Perl Mouse in thread Average calculation by kk1173