Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Genbank file parsing

by gube (Parson)
on Jan 11, 2005 at 12:51 UTC ( #421263=note: print w/ replies, xml ) Need Help??


in reply to Genbank file parsing

if u want to extract Origin to // in the text file globally

you try this

undef $/; open (FILE, $ARGV[0]) or die "unable to open FILE\n"; my $input=<FILE>; close(FILE); my @final=(); while ($input=~m#ORIGIN(.*?)//#gsi) { push(@final,$1); } print @final;

input file "text.txt" contains

**********************************************

FEATURES Location/Qualifiers

/note="blah blah"

COUNT 200

ORIGIN

1 lots of nice info

61 lots of nice info

121 lots of nice info

//

ORIGIN

1 lots of nice info

61 lots of nice info

121 lots of nice info

//

ORIGIN

1 lots of nice info

61 lots of nice info

121 lots of nice info

//

ORIGIN

1 lots of nice info

61 lots of nice info

121 lots of nice info

//

***********************************

output file is look

**********************

1 lots of nice info

61 lots of nice info

121 lots of nice info

1 lots of nice info

61 lots of nice info

121 lots of nice info

1 lots of nice info

61 lots of nice info

121 lots of nice info

1 lots of nice info

61 lots of nice info

121 lots of nice info

Regards,

Senthi Kumar.k


Comment on Re: Genbank file parsing
Download Code
Re^2: Genbank file parsing
by YuckFoo (Abbot) on Jan 11, 2005 at 23:08 UTC
    gube,

    A useful feature for code snippets and experiments is the special __DATA__ section that can be added at the end of your program file. You can read from the DATA file handle with no need to create and open an input file:

    #!/usr/bin/perl while (<DATA>) { print; } __DATA__ foo goo hoo

    __DataFoo__

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://421263]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2014-12-21 16:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (106 votes), past polls