Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 surveying the Monastery: (11)
As of 2014-09-30 13:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (372 votes), past polls