@JC OP is using a GenPept file, which should have similar format. host entry must be specific to OP's file.
LOCUS AAA40590 109 aa linear ROD 27-APR-1993
DEFINITION insulin [Octodon degus].
ACCESSION AAA40590
VERSION AAA40590.1
DBSOURCE locus OCOINS accession M57671.1
KEYWORDS .
SOURCE Octodon degus (degu)
ORGANISM Octodon degus
Your code produces:
$ perl -lane 'print $1 if(/VERSION\s+(.+)/ or /host="(.+)"/)' < sequence.gp
AAA40590.1
• 0 views
•
link
please post few lines from input file.
Hello Sir Thank you for your response this is a brief summary for my input file
This is a genbank file yes? If so the Accession and organism information will likely be in the header lines.
You also haven't told us why your grep command fails - in what way is it incorrect?