parsing and searching big text files

Gabor Gludovatz ggabor at sopron.hu
Wed Dec 6 12:29:25 EST 2000


Hello,

I have a big text file which contains 3 variable lenght columns with
names. I have to search this file for names in either column and have to
show to other 2 names, and I have to do this very fast!

The text file is about 3 megs long. Does someone know a method to do this
quickly?

Which is the faster, should I read to whole text file into the memory and
parse and search it there, or should I read it from the disk line by line
and parse it..?
the last seemed to be very slow.

Here is an example line from this text file:
Foo Bar:John Doe:Bill

If I look for, for example, John Doe, the function should return Foo Bar
and Bill and all the other records which contain John Doe.

Again: I have to do it very fast.


-- 
 Gabor Gludovatz <ggabor at sopron.hu> http://www.sopron.hu/~ggabor/






More information about the Python-list mailing list