Seaching files

Bruce Lewis lewisbruce at rogers.com
Fri Feb 18 09:46:12 EST 2005


I have a large number of files that are loaded into a Viewer stack as I
need them. They are in HTMLText so that styled text can be loaded into the
field on the Viewer stack. Right now there are 3,568 separate files, but
this will soon more than double. Some files are tiny. Some are huge.

I want to do a search through some or all of the files and develop a list
of files in which the search string is found.

Originally, I decided not to search the text of the files directly because
the HTML tags might confuse the search. Suppose for instance that a
character or word within the search string was in bold. A search through
the raw HTMLText would not find it.

Therefore, in a repeat loop I set the HTMLText of a hidden field to each
file. I then determine if the search term is in the field.

This takes too long. I have an alternative where I just

    get URL ("file:" & line i of gInfoCdsList)

If the search string is in "it", then I include that file.

The second method takes about 15 to 20% of the time that the first method
takes. I did a couple of tests and the files found were exactly the same.

I am now thinking that I will have a quick search and a more thorough
search for the user to deal with this.

Any other thoughts or recommendations.

Thanks.

Bruce

-- 


More information about the use-livecode mailing list