#!/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
In reply to Re: chopping new line while counting length
by andye
in thread chopping new line while counting length
by sugar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |