I will do some testing and see which method is the most efficient. I.E. load all the files
into Rbase and search as mentioned below, or let an outside program such as FIND do the search and output the file list into Rbase. I believe either will do the trick ,it is just which is the most efficient. Thanks all, -Bob ----- Original Message ----- From: "Lawrence Lustig" <[email protected]> To: "RBASE-L Mailing List" <[email protected]> Sent: Tuesday, November 10, 2009 11:58:33 AM GMT -06:00 US/Canada Central Subject: [RBASE-L] - Re: Searching for file contents << This could be done by using the Windows Search option and manually opening the file, but I am wanting it to be an option within my application. The key here is that a typical search will be going through hundreds of files and needs to be a very efficient method. >> MikeB's solution (as is often true) is the best -- you can get a list of the files in R:Base, then loop through the files, loading each into a VARCHAR variables and using SLOC to determine whether your string is found in the file. If yes, you can add the file to a list (in a temp table or variable user-defined combobox), optionally storing a few hundred characters on either side of the SLOC position as a "snippet", and show the results to the user. To get a list of filenames matching a spec you can execute DIR *.whatevver > TempFile and then load temp file into a temporary table. If you haven't done this before, I can post code that does it. Alternatively, you could use an external text searching tool that creates an output file containing a list of files that have your text and load that output file into R:Base. -- Larry

