Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Using less memory with BIG files

by GrandFather (Sage)
on Feb 02, 2012 at 20:24 UTC ( #951524=note: print w/replies, xml ) Need Help??

in reply to Using less memory with BIG files

I don't see any "make a database" in there. Do you mean you want to use two existing files as a database, using one as a key column for example? Or do you mean that you want to take the data from two existing files and generate a database from them? Or maybe you mean something else?

In any case, we can probably help you more if you show us just a little more of the code, especially the output part. Even just making clear what you want to achieve end to end would help a lot.

As an aside, don't use our, it's not doing what you think or what you want. Use my instead. $acnumbers and @list should be defined (using my) inside the for loop - the undef is not needed then.

It may be that your code does show the output you really want (I missed the possibility due to using select instead of print $outFile ...). BTW, did I mention you should always use three parameter open and lexical file handles? You should!

In any case if you want a database use one - I'd suggest SQLite in this sort of context.

True laziness is hard work

Replies are listed 'Best First'.
Re^2: Using less memory with BIG files
by jemswira (Novice) on Feb 04, 2012 at 17:02 UTC

    Well actually what i want is in this format:

    Q8K9W0 | name |PF10417.4/ PF10425.1

    the name is in a third file that also has the IC number, the Q8K9W0 part. its the one with this format:

    >tr|A0FGZ9|A0FGZ9_9ARCH Methyl coenzyme M reductase (Fragment) OS=uncu +ltured archaeon GN=mcrA PE=4 SV=1 >tr|A0FH03|A0FH03_9ARCH Methyl coenzyme M reductase (Fragment) OS=uncu +ltured archaeon GN=mcrA PE=4 SV=1

    so that's what i need. also, what is a three parameter open and lexical file handles? all i know i learnt from the first 6 chapters of Beginning Perl by Simon Cozen

      The answer to both your questions happen to be in the open link I gave you. Aside from asking for help here, it is worth finding out how to use the Perl documentation that almost certainly was installed with your Perl. Try typing perldoc from your command line.

      True laziness is hard work

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (14)
As of 2016-10-27 13:49 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (362 votes). Check out past polls.