#!/usr/bin/perl # ispisuje totale my $total=(); while(<>) { chop(); if (/(\d+)-(\d+)-(\d+) (\d+) (\d+)/) { $total{"$1-$2"}[0]+=$4; $total{"$1-$2"}[1]+=$5; } } foreach(sort { $a cmp $b } keys %total) { print "$_ $total{$_}[0] $total{$_}[1]\n"; }