Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: extract relevent lines according to array

by Skeeve (Vicar)
on Apr 19, 2010 at 14:47 UTC ( #835501=note: print w/ replies, xml ) Need Help??


in reply to extract relevent lines according to array

$chrom='chr1'; $start=9839; $stop=9841; while (<DATA>) { if (/variableStep chrom=$chrom/ ... /variableStep chrom/) { if (/^$start\b/ .. /^$stop\b/) { chomp; push @result, (split ' ',$_,2)[1]; } } } use Data::Dumper; print Dumper \@result; __DATA__ variableStep chrom=chr1 9837 0.010 9838 0.008 9839 0.007 9840 0.004 9841 0.002 9842 0.001 variableStep chrom=chr2 9837 0.090 9838 0.038 9839 0.017 9840 0.044 9841 0.052 9842 0.091

s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e


Comment on Re: extract relevent lines according to array
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://835501]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2015-07-30 21:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls