in reply to RegEx misbehaving?
Some of that code massaging is style but it will also be much faster than your current code as most of the fiddly stuff is now done by perl and it also saves a lot of hard-coding. See. push, index, shift for more info on the functions used above.while ( $line = <TR_INFILE> ) { if ( index( $line, 'R' ) == 0 ) { ## removed /g as it's unnecessary $line =~ s/^Results://; print OUTFILE3 "$line"; ## the ' ' is special, see. perldoc -f split my @chunks = split ' ', $line; push @trstart, shift @chunks; push @trend, shift @chunks; push @period, shift @chunks; push @copy, shift @chunks; push @consize, shift @chunks; push @matches, shift @chunks; push @indels, shift @chunks; push @score, shift @chunks; push @numa, shift @chunks; push @numc, shift @chunks; push @numg, shift @chunks; push @numt, shift @chunks; push @entropy, shift @chunks; $TRID++; } elsif ( index($line, 'S') == 0 ) { $line =~ s/^Sequence:\s*//; push @TR_Accession, $line; $SEQID++; } }
_________
broquaint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: RegEx misbehaving?
by Bilbo (Pilgrim) on Jul 18, 2003 at 10:45 UTC |