Searching through binary/text files efficiently

Richard Gaskin ambassador at fourthworld.com
Tue Sep 11 13:56:52 EDT 2007


Mikey wrote:
> I don't know how long it will take to do this using RR's built-in
> search function, but the most efficient algorithm in general is the
> Boyer-Moore-Sunday algorithm for doing general text processing.  The
> problem you are going to have is that BMS assumes that it is searching
> normal text space.  However, you can use the concepts of BMS to write
> a very fast search algorithm.
> 
> If you need help, please let me know.

If you have a BNS in Transcript that would be handy. :)

I wonder which algo Rev uses -- anyone here know?

This raises a point that may be of interest to the original poster:  By 
default, Rev searches are case-insensitive, so some searches of binary 
strings may yield false positives.

This can be corrected by setting the caseSensitive global property to 
true first:

   set the caseSensitive to true
   if tMySearchString is in tMyData then


-- 
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com



More information about the use-livecode mailing list