in reply to Re^2: search a large text file
in thread search a large text file
This is the ideal application for a hash tied to a file. You might like to take a look at DBM::Deep. This is a well-tested and well-liked implementation of a disk based hash.
Just use a script to generate your hash once (that will take a while), after that any search will be nearly as fast as a single disk access. Store multiple values either concatenated as a string or better use an array for that. Since DBM::Deep is multilevel, storing a HashofArrays is no further problem
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: search a large text file
by perl_lover_always (Acolyte) on Feb 08, 2011 at 14:41 UTC | |
by jethro (Monsignor) on Feb 08, 2011 at 17:34 UTC | |
by perl_lover_always (Acolyte) on Feb 10, 2011 at 09:45 UTC | |
by jethro (Monsignor) on Feb 10, 2011 at 10:16 UTC | |
by perl_lover_always (Acolyte) on Feb 10, 2011 at 10:25 UTC | |
|