You can set the file as a VarChar and use SLOC to determine if the string value is in the file.

Set var VFile VarChar = ['TheFullPathNameOfTheFile']

set var vSloc integer = (SLOC(.VFile, 'ST*856*123'))
if vSloc > 0 then
 pause 2 using '"ST*856*123" found in current file'
else
 pause 2 using 'No Matching String in current file'
endif



----- Original Message ----- From: <[email protected]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Tuesday, November 10, 2009 10:03 AM
Subject: [RBASE-L] - Searching for file contents




In Windows you can search for a specific text string in all files for a folder(s).

DOS has a similar FIND command.



I need to be able to execute this function from within Rbase. Say there are 100 files

in a folder and I need to find the one that has "ST*856*123" in it.



I can ZIP a FIND command, output the results to a text file, load the text file into Rbase

and then parse the temp table to see if the string was found.



Any better ideas on how to accomplish this?



Thanks,

-Bob

Reply via email to