good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Scanning a text fileby Steve_p (Priest) |
on Apr 09, 2004 at 16:13 UTC ( [id://343933]=note: print w/replies, xml ) | Need Help?? |
This is a problem that is screaming to be solved by a simple search engine. Check out Plucene and Plucene::Simple. There is also a nice tutorial on it at Perl.com. Yes, the article talks about a web-based search engine, but putting it into a script should be just as easy. In your situation, you'll need an initial parse on the file to create the indexes, but after that the lookups should be quick. It will also return the full record or records related to your search.
In Section
Seekers of Perl Wisdom
|
|