|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
Re: compare values while value on other column remains the sameby aaron_baugher (Chaplain) |
| on Sep 22, 2012 at 02:08 UTC ( #995021=note: print w/ replies, xml ) | Need Help?? |
|
In your sample, the first three fields always match when the fourth (ID) field matches. If that's always the case, you could concat those fields into your key. If it's not, you might need to save the lines into an array keyed on the ID field, and then print them out. For now, I assumed they'd be identical as in the sample, and just printed out the IDs and averages. I also assumed that you wanted to average the absolute differences. In other words, if one was 50 100 and the next was 100 50, those would average a difference of 50, not zero (from averaging 50 and -50). I also assumed from your code that you want to divide the numbers by 1000. When I did that, none of the averages exceeded 0.2, so I printed all greater than 0.02 so I'd have some output. Hopefully this will give you some ideas:
Aaron B.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||