Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Genbank file parsing

by EdwardG (Vicar)
on Jan 11, 2005 at 13:04 UTC ( #421265=note: print w/ replies, xml ) Need Help??


in reply to Genbank file parsing

You might find it easier if your consider the file as a long string, one that happens to contain embedded newline characters.

my $data = do {local $/; <DATA>}; my @items = map { { 'name' => $1, 'niceinfo' => $2 } } ($data =~ /^FEATURES(.+?)^ORIGIN(.+?)^\/\//msg);

 


Comment on Re: Genbank file parsing
Download Code
Re^2: Genbank file parsing
by blazar (Canon) on Jan 11, 2005 at 14:03 UTC
    You might find it easier if your consider the file as a long string, one that happens to contain embedded newline characters.
    IMHO this qualifies as a particularly bad answer since he specifically pointed out that his file is large and it is always recommended not to slurp large files all at once if possible. Now I don't see anything here that suggests this to be necessary...

      It depends just how large the file is, how much memory is available, and other various trade-offs. But you are probably right in general, although I would quibble about "particularly bad" :-/

       

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2015-07-02 01:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (25 votes), past polls