This is the source file content
LOCUS YP_001648463 258 aa linear INV 17 +-JUN-2009 DEFINITION cytochrome c oxidase subunit II [Ephydatia muelleri]. ACCESSION YP_001648463 VERSION YP_001648463.1 GI:164420795 DBLINK Project: 28177 DBSOURCE REFSEQ: accession NC_010202.1 KEYWORDS . SOURCE mitochondrion Ephydatia muelleri ORGANISM Ephydatia muelleri Eukaryota; Metazoa; Porifera; Demospongiae; Ceractinomorph +a; Haplosclerida; Spongillidae; Ephydatia. REFERENCE 1 (residues 1 to 258) AUTHORS Lavrov,D.V., Wang,X. and Kelly,M. TITLE Reconstructing ordinal relationships in the Demospongiae u +sing mitochondrial genomic data
This is the program , i have written
use strict; use warnings; open (PROTEIN,"<invertebrate.protein.gpff") or die $! ; my @prot=<PROTEIN>; my $protlen=$#prot; my $version="VERSION"; my $dbsource="DBSOURCE"; my $protname; my $rna; for(my $i=0;$i<=$protlen;$i++) { if((substr($prot[$i],0,7)) eq $version) { # have to store the value of "YP_001648463.1" in $protname } if((substr($prot[$i],0,8)) eq $dbsource) { # have to store the value of "NC_010202.1" in $rna } } close PROTEIN;
My required strings are mentioned in the commented lines of the IF statement.Can someone tell me, how to extract this data and store in those respective scalars
In reply to Extract the matching strings by sundeep
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |