aditi gupta wrote:
hi to all,
i have a file $seq, in following format:
gi|37182815|gb|AY358849.1| gi|2353725|gb|AF015490.1|AF015490 100.00 16 0 0 544 559 320 335 4.2 32.21
gi|37182815|gb|AY358849.1| gi|1335960|gb|U55203.1|BTU55203 100.00 16 0 0 544 559 380 395 4.2 32.21
gi|37182815|gb|AY358849.1| gi|1335958|gb|U55202.1|BTU55202 100.00 16 0 0 544 559 443 458 4.2 32.21
i split it into arrays using:
@seqs=split(/gi|37182815|gb|AY358849.1|/,$seq);

split 'consumes' the pattern matched by its first argument. I think you probably want something like: (untested)


@seq = split( /\|/, $seq );

and then split the last field on spaces:

push @seq, split( /\s+/, pop(@seq) );

Regards,
Randy.

--
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