Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Text search challenge...
Message
From
16/02/2003 22:12:18
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00753959
Message ID:
00753976
Views:
19
This looks very cool. I can't wait to get to work on Monday to try this. If it helps the speed, one dude in my office will try to kiss me. Thanks. I love UT.


>It may be faster to search using Filler.dll that comes with VFP and then process only files with matches.
oFiler = CREATEOBJECT('Filer.FileUtil')
>oFiler.SearchPath = "H:\temp"
>oFiler.FileExpression = '*.txt'
>oFiler.SearchText1 = lcSearchText
>oFiler.SubFolder = .T.
>
>? oFiler.Find(0)
>? oFiler.Files.Count
>FOR i=1 TO oFiler.Files.Count
>	? oFiler.Files.Item(i).Name
>	? oFiler.Files.Item(i).Path
>ENDFOR
>
>
>>Who can offer the most efficient (i.e. fastest) code to accomplish the following?
>>
>>I need to search 3,000 ascii text files spread among approximately 20 sub-dirs. The files might contain 200-300 lines, bu I only need to search the first 7 lines of each file for a short keyword that the user will enter into a textbox. I report all matches into a listbox.
>>
>>My current method opens the file for an ascii read, then "for x= 1 to 7" and use the ATC() function to look for a match on each read line. It works, but it's kinda slow, just becuase there are so many files.
>>
>>I will post my code when I get to work on Monday, and you can critique it.
>>
>>Thanks.
Previous
Reply
Map
View

Click here to load this message in the networking platform