Is this your homework?

On 2/14/2014 1:48 AM, Parysatis Sachs wrote:
Hi everyone!

I'm new to this mailing list as well as to programming and Perl in
general. So there is a chance I might ask relatively stupid questions
with very obvious answers... Please bear with me!

So, here it goes:

I have a very long string with lots of Ns in it, like this:
attttgctagccgagctaNNNNNNatggctaNNNNNNNatgcccctgaNNNNNNatg

So, I want to get rid of the Ns and get ONE SINGLE newline for each
group of Ns

So far I've managed to do this:

if ($joinedDNA =~ s/N+/\n/g) {

$joinedDNA =~ s/\R//g;

}

But now I have everything joined together and can't tell where the Ns
were before. I want output like so:

attttgctagccgagcta

atggcta

atgcccctga

atg


Thanks for your help everybody, I really appreciate it!

Parys



---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com



--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to