in reply to Aggregation of Similar Lines
$data{2584311} = [ [ "12/30/02", "12/29/02" ], [ 12, 12 ] ];
That is, a hash, keyed on Field2, with the data being a list of lists of the Fields 1, and 3 (of course you will extend it to how ever many fields you need). After you create this, it is easy enough to go through it and divide by however many elements there are, and print out the data to a new file.
You never state how big your file is, so I don't know if reading the entire thing into memory will be a problem or not. This example also assumes it is field 2 that you use to decide if the 2 lines are the same or not. If you use some other field or combination of fields to decide that, use it as the key.
|
|---|