Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Automating the input to exe file

by Solo (Deacon)
on Jan 26, 2005 at 20:25 UTC ( [id://425365]=note: print w/replies, xml ) Need Help??


in reply to Automating the input to exe file

I think this problem can be simplified by thinking about the file as multi-line records. Change your record separator to '>>' and process only the records meeting your threshold. Be sure to include the 'm' at the end of the regex for multi-line matching.

my $threshold = <STDIN>; # or so... my @records; { local $/ = ">>"; while (<FASTA>) { if ( /(\d+\.\d+)% identity/m ) { push @records, $_ if $1 > $threshold; # - or - # process($_); } } } # @records now holds lines meeting threshold # process as needed... # - or - # sub process { ... }

--Solo

--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-26 05:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found