new19 has asked for the wisdom of the Perl Monks concerning the following question:
my sequence is like that i want to extract the two 5 digits number using the split function .how i can do that scaffold_12147 protein_coding exon 32192 32242 . - . gene_id "ENSTBEG00000007763";
#!/usr/bin/perl use warnings; use strict; my @records; open FILE, "vik.txt" or die $!; while(<FILE>) { chomp; my @columns = split ' ', $_; push @records, \@columns; } foreach my $record(@records) { if ($record->[2] eq "exon") { split ('d+',@$record); print "$record \n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: string problem
by moritz (Cardinal) on Mar 31, 2011 at 12:01 UTC | |
by new19 (Initiate) on Mar 31, 2011 at 12:10 UTC | |
by moritz (Cardinal) on Mar 31, 2011 at 12:13 UTC | |
by new19 (Initiate) on Mar 31, 2011 at 12:17 UTC | |
by moritz (Cardinal) on Mar 31, 2011 at 12:34 UTC | |
by jethro (Monsignor) on Mar 31, 2011 at 12:38 UTC | |
|
Re: string problem
by Marshall (Canon) on Apr 02, 2011 at 19:51 UTC |