Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Can you help me with these one-liners?

by BrowserUk (Patriarch)
on Apr 22, 2014 at 15:20 UTC ( [id://1083190]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    Example1:
    perl -e 'while(<>) {if($_=~/^>/) {print $_;} else {$_=~tr/ATCG/TAGC/; 
    +print $_;}}'  FILE
    
  2. or download this
    perl -nle 'if($_=~/^>/) {print $_;} else {$_=~tr/ATCG/TAGC/; print $_;
    +}' FILE
    
  3. or download this
    perl -nle 'if(/^>/) {print;} else { tr/ATCG/TAGC/; print; }' FILE
    
  4. or download this
    perl -ple 'if(/^>/) { ; } else { tr/ATCG/TAGC/; }' FILE
    
  5. or download this
    perl -ple 'tr/ATCG/TAGC/ unless( /^>/ );' FILE
    
  6. or download this
    perl -ple '/^>/ or tr/ATCG/TAGC/' FILE
    

Log In?
Username:
Password:

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

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

    No recent polls found