#!/afs/athena/contrib/perl/perl
# NOTE: this takes the output of
#    gsort +7.8n +7.4M +7n
# on the log digest and unifies it...

while (<>) {
    ($req,$foo,$mit,$foo,$date) = unpack("a6a11a5a14a11", $_);

    if ($date eq $odate) {
	$req += $oreq;
	$mit += $omit;
    } else {
	printf "%6d accesses (%5d from mit) on %s\n", $oreq, $omit, $odate
	    if $odate;
    }

    $oln = $_;
    ($oreq,$omit,$odate) = ($req,$mit,$date);
}

printf "%6d accesses (%5d from mit) on %s\n", $oreq, $omit, $odate;
