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

Re^2: Print a previous to previous of a matching line

by ag88 (Novice)
on Oct 11, 2013 at 07:49 UTC ( [id://1057844]=note: print w/replies, xml ) Need Help??


in reply to Re: Print a previous to previous of a matching line
in thread Print a previous to previous of a matching line

Thankyou all for the suggestions. It was really helpful. The following code did my task

sub getGiForZeroHits { my $previous1,$previous2; open(FILEOUT,">giForZeroHits.txt") or die("Cannot open file"); { open(FILE, "$inputSeqFileForBlast-1e-10.out") or die("Cannot open file +"); { while(<FILE>) { my $line = $_; if($line=~/# 0 hits found/) { my @lineSpl = split(/\|/, $previous2); print FILEOUT "$lineSpl[1]\n"; } #close if $previous2= $previous1; $previous1= $line; } #close while close(FILE); } #close FILE close(FILEOUT) } #close FILEOUT } #close sub

Log In?
Username:
Password:

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

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

    No recent polls found