There's more than one way to do things | |
PerlMonks |
Very large text file - simple indexingby Anonymous Monk |
on Apr 09, 2003 at 19:57 UTC ( [id://249393]=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: I apologize if this is an utterly clueless question, but I'm a newbie so here goes: All I want to do is to be able to correlate two entries in a very large text file, for instance the file is of the format:
...and so on with tabs separating the columns. I'm going to be accessing this array hundreds of thousands of times. Now the approach for this that seemed obvious to me was just like this:
Which is great, now we have $index(field 1 value) = field 2 value, which is what I wanted. and works great for the original 40 meg text file. The problem comes with the new text file, which is almost 400 megs (many millions of entries). My system slows to a crawl and eventually seizes up. I assume this is most likely memory issues (only 256M physical due to a RAM blowout, another 500 M swap) or something, but I'm not sure. Is there a better way to do this kind of thing for a huge text file like this?
Back to
Seekers of Perl Wisdom
|
|