Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Search for a string in a group of files
Message
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00649837
Message ID:
00650435
Views:
24
>>>>Anyone know the VFP syntax for an API or WSH function that will return an array of filenames whose contents contain a specified string? TIA!
>>>
>>>You can use Filler.dll that comes with VFP.
oFiler = CREATEOBJECT('Filer.FileUtil')
>>>oFiler.SearchPath = "H:\temp"
>>>oFiler.FileExpression = '*.PRG'
>>>oFiler.SearchText1 = "LOCAL"
>>>?oFiler.Find(0)
>>>? oFiler.Files.Count
>>
>>This works great as long as the files are text files. It does not work on ZIP [or any binary?] files.
>
>I searched FXP and ZIP files for a text string and it worked fine. What problem do you have?

Hmmm. I did a search for a prticular string in a bunch of .TXT files and got 3 or 4 results. I then searches a group of ZIP files that were created by zipping up each TXT file in there own ZIP file. DOH! It just occurred to me that those ZIP files whose creation I have automated for an update service are encrypted with a password. That would be the problem. Thanks for the kick-start.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform