I need to group rows based on the first column then to calculate the summation of the values of all second row and the summation of the values of all third row.The second column should be calculated as following:  10:56 = 10*60 + 56 = 656 seconds.Input file:     testing 00:34 123487     archive 00:45 3973     testing 09:16 800500     archive 10:10 100000Output:     archive 655 103973     testing 590 923987
Group all rows based on the first column then calculate the total of the second and third columns
text processing;awk;sed
Golfed it down to a one-liner.  Works fine on GNU awk 3.1.7.  Other awk implementations might need the $2*60 replaced with substr($2,0,2)*60.  (Expecting the likes of '09:16' to get interpreted as an integer value of 9 is stretching the rules a little.)awk '{a[$1]+=$2*60+substr($2,4);b[$1]+=$3}END{for(c in a){print c,a[c],b[c]}}'Giving output:archive 655 103973testing 590 923987Alternatively, a perl approach:perl -e 'while(<>){/(\S+) +(\d+):(\d+) (\d+)/;$a{$1}+=$2*60+$3;$b{$1}+=$4;}for(keys %a){print $_ $a{$_} $b{$_}\n}'