Turn part of a string into a single newline

2014-02-13 Thread Parysatis Sachs
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: agctagccgagcta

Re: Turn part of a string into a single newline

2014-02-14 Thread 巍俊葛
Hi Parys, Your statement "$joinedDNA =~ s/\R//g;" will remove new line in the string. You may remove this statement. thanks, Kimi On 14 February 2014 15:48, 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 ch

Re: Turn part of a string into a single newline

2014-02-14 Thread Shaji Kalidasan
Dear Parys, Here is one way to do it [code] use strict; use warnings; my $str = "agctagccgagctaNNatggctaNNNatgtgaNNatg"; $str =~ s/N+/\n/g; ### #Print the string as is (commented out) #print $str, "\n"; ### print '-' x 40,"\n"; #Split the string on

Re: Turn part of a string into a single newline

2014-02-14 Thread Bill McCormick
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

Re: Turn part of a string into a single newline

2014-02-14 Thread Brian Fraser
On Fri, Feb 14, 2014 at 2:14 PM, Bill McCormick wrote: > Is this your homework? Does it matter? They've shown their work, what they expected to happen and what happened instead. I think the only missing bit would've been "I checked in X documentation and couldn't find the answer"

Re: Turn part of a string into a single newline

2014-02-14 Thread Bill McCormick
On 2/14/2014 3:39 AM, kimi ge(巍俊葛) wrote: Hi Parys, Your statement "$joinedDNA =~ s/\R//g;" will remove new line in the string. You may remove this statement. Yea, I don't see that you need that either. maybe you were just trying to get a new line at then end? $joinedDNA =~ s/N+|$/\n/g;

Re: Turn part of a string into a single newline

2014-02-14 Thread John W. Krahn
Parysatis Sachs wrote: Hi everyone! Hello, 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