[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: indexing - Re: [MacPerl] Some suggestions?



Scott Prince writes:
|Say for instance... I have a huge plain text data file (about 10mb, not 
|practical to read into memory) and index all of the words in the file. A 
|search on the index file quickly returns all the rows that match the 
|given word(s). Now I need to open the actual data file and go directly to 
|a given row. Given that I now know what line number(s) I need to go to, 
|is there any way to to skip over the rows I do not need and pull out just 
|the row(s) I want?

Assuming the rows are all different lengths, and there's nothing in a row
that tells you what row it is, no. However, when you're building the index,
instead of (or in addition to) the row, keep the position in the file where
you found the word then just seek to it upon lookup.

Brian

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org