From: Edward Wijaya <mailto:[EMAIL PROTECTED]> wrote:

::     How about:
:: 
:: my @crseq;
:: while ( <> ) {
::     next unless/^[ACGT]/;
::     chomp;
::     push @crseq, $_ . scalar <>;
:: }
:: print @crseq;
:: 
: 
: Hi Charles,
: 
: Thanks for your reply.
: 
: Your code works for my example in email, but not the file
: with more lines, (please see attached file).
: 
: So sorry if I didn't give precise example.

    Well, be that way!

my @crseq;
while ( <> ) {
    # start new line
    push @crseq, '' if /^>/;

    # kill the line ending
    chomp;

    # concatenate current line
    # to the last array item
    $crseq[-1] .= $_
}
print "$_\n" foreach @crseq;

HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to