Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: chopping new line while counting length

by andye (Curate)
on Jan 15, 2009 at 11:51 UTC ( #736519=note: print w/replies, xml ) Need Help??

in reply to chopping new line while counting length

An alternative way to do it:

#!/usr/bin/perl -w undef $/; use strict; $_ = <DATA>; while (m/\G(>IDnumber\d+ length=)350\n([^\n]+)\n([^\n]+)\n/g) { print $1.length($2.$3)."\n$2$3\n"; } __DATA__ >IDnumber1 length=350 AGCTG AAGTCGCT >IDnumber2 length=350 AGAACGT ACC >IDnumber3 length=350 AGC ACTTCGCTAACT

Hope that's helpful to you.

Best wishes, andye

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://736519]
[LanX]: due coretti, per favore! ;-)
[shmem]: grappa, ginebra o amaretto?
[shmem]: LanX: tried strange stuff wrt autocomplete. No luck :(
[erix]: sambuca
[LanX]: machiato!
shmem fills a glas with sambuca, drops 3 beans of coffee into it, lights the stuff and hands it to erix

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (12)
As of 2017-03-28 12:13 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (330 votes). Check out past polls.