in reply to Merging partially duplicate lines

The best approach is to identify the duplicates using the approach found in perlfaq4. Merging the values of two duplicates sounds to be mostly a matter of arithmetic.

Where in the task do you have problems?