Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: compare values while value on other column remains the same

by choroba (Chancellor)
on Sep 21, 2012 at 19:39 UTC ( #994984=note: print w/replies, xml ) Need Help??


in reply to compare values while value on other column remains the same

What output do you expect from the given sample data? I do not understand the specification.

Note that eof returns 0 or 1 if used as a number, so $i < eof will not do what you think.

Replies are listed 'Best First'.
Re^2: compare values while value on other column remains the same
by linseyr (Acolyte) on Sep 21, 2012 at 19:47 UTC
    Actually, my output would be:
    $chr $begin $end $id $average
    But I just wanted to start with calculating. I would like to calculate the average difference between the 2 columns (5 and 6) for the same id. So for line 3,4,5 I would like to calculate the average difference between column 5 and 6. And for the lines for which only one line has that id, like line 1 I just want to calculate the difference between column 5 and 6, since there is no average to calculate. I only want to output the lines that have a average difference > 0.2

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://994984]
help
Chatterbox?
stevieb is writing a little CUFP on how to control analog pins on an arduino from a Linux machine via I2C in light of Perl, JavaScript and Strandbeests. It also is a good real-world use-case to test my I2C dist.
[stevieb]: I just don't feel like going hardcore on anything today, so I thought I'd *use* my software instead of just write it
[beech]: let the surprises begin :D

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2017-07-21 23:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (336 votes). Check out past polls.