View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
J@Y J@Y is offline
external usenet poster
 
Posts: 127
Default Load text file into memory for searching?

It is. Because right now, I have something that searches through the text
line by line with textCompare and it is quite slow (averaging about 3-4
seconds per search). Will the Binary method help in speeding things up?

I remember a friend once told me that if you load a text file into memory
and perform binary search, the maximum amount of time is equal to Log(N) vs
if you read it line by line its maximum time is N. I'm new to programming so
if someone can enlighten me on this, it'll be much appreciated.

"NickHK" wrote:

Check out the Open statement in the VBA Help: Their example of
Open "TESTFILE" For Binary Access Write As #1

However, if this is connected with your 1 ~ 5 million row text file, you
will probably have to do it in chunks.

NickHK

"J@Y" wrote in message
...
Is it possible to load a text file into memeory and perform binary

searches
to increase speed?