Welcome to the Monastery | |
PerlMonks |
Re: Remove row if the absolute difference between two columns is greater than a thresholdby ack (Deacon) |
on Feb 15, 2011 at 17:48 UTC ( [id://888327]=note: print w/replies, xml ) | Need Help?? |
Here's a short script that I think does what you're after. I didn't spend any time optimizing it; so it is just so you can see a quick and dirty strategy. It uses Perl references to create 2 dimensional matrices and the arrow notation to simplify and clarify what is going on. The subrouting, printMatrix(), is just for convenience so that you can better see what the 'before' and 'after' situation looks like.
The output from the little script is:
Good luck; welcome to Perl.
ack
Albuquerque, NM
In Section
Seekers of Perl Wisdom
|
|