Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Unable to extract matched string from input

by drmrgd (Beadle)
on Sep 25, 2013 at 10:19 UTC ( #1055647=note: print w/replies, xml ) Need Help??


in reply to Unable to extract matched string from input

Rather than splitting on whitespace since there is whitespace in the descriptions as well, why not just split the whole data chunk with a regex from the start. Assuming that your entries are always formatted with the chr, start, end, and description, you could do something like:
my ( $chr, $start, $end, $description ) = $annotation_line =~ /(chr\d+ +) (\d+) (\d+) (.*)/; if ( $description =~ /dgv_Cnv=True,overlap=\d+\.\d+%;/ ) { print "$chr\t$start\t$end\t$&\n"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1055647]
help
Chatterbox?
[karlgoethebier]: holli: Red Coke? It's called "Korea" - cheap red wine wine coke :-(
[choroba]: we call it "mushroom" here
[karlgoethebier]: had his first oysters this year for lunch - with some really white wine. Great
[karlgoethebier]: choroba: this drink makes blind...
[erix]: handy, no blindfold needed

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2017-09-25 13:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (280 votes). Check out past polls.

    Notices?