Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: find reverse complement of every 2nd line

by syphilis (Canon)
on Jul 09, 2013 at 23:40 UTC ( #1043396=note: print w/ replies, xml ) Need Help??


in reply to Re^2: find reverse complement of every 2nd line
in thread find reverse complement of every 2nd line

my problem actually is doing this only to every other line and not the entire file

The special variable $. (documented in perldoc perlvar) keeps count of the line numbers, so you can do something like:

while(<IN>) { next if $. % 2; # skip odd lines # do the processing }
Cheers,
Rob


Comment on Re^3: find reverse complement of every 2nd line
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2014-09-19 07:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (133 votes), past polls