i have this input file
1.00 3 4
93.00 2 3
105.00 0 2
119.00 0 2
122.00 1 4
202.00 1 3
207.00 1 2
210.00 1 4
236.00 0 1
237.00 0 4
237.00 0 2
240.00 1 3
243.00 2 3
243.00 3 4
243.00 0 3
275.00 0 4
275.00 2 4
353.00 0 3
361.00 1 4
411.00 0 1
412.00 1 3
425.00 0 3
426.00 0 4
455.00 1 4
464.00 0 3
520.00 0 4
560.00 1 3
561.00 1 4
581.00 0 2
and i want to it be like this as the output
and compute this information
field1 field2 nbrepeated time1 time2 time3 time4
3 4 1 1.00 243.0 0 0
2 3 1 93.0 243.0 0 0
0 2 2 93.00 119.00 237.00 581.00
: : : : : : :
: : : : : : :
: : : : : : :
<field1> <field2> <nbrepeated> <time1> <time2> <time3> <time4> are columns
A perl version:
Produces the output:
The output is unsorted. Sorting it would be no problem, if you specify what way you want it sorted.