Thank you to all who replied.  I think I need to explain a bit further. 



First I am not needing to replace strings, but simply find what files may 
contain a string. 

We recieve documents via EDI that contain several types of information, such as 
Purchase Orders, 

Advanced Ship Notices, Invoices, etc. etc. 



These documents come in through an AS2 or VAN (ftp) connection and are 
processed continously, 

24 hours per day.  The file names that these documents come in have no 
relevance to what they are.  

Usually the format is YYYYMMDDxxx.xxx  with x being a sequential number.   
However, the format 

does differ from various sources.  So a PO  and an Invoice document is not 
dicernable by the file name. 



On occasion, a user will need to look at the raw data (i.e. the YYYYMMDDxxx.xxx 
or whatever file) that a 

certain PO, Invoice, ASN etc.  came in on.  It may be 2 or 3 days later for 
example and hundreds of files have been recieved in since. 



I want to create a button that a user can enter a PO number, invoice number 
etc. and the program do 
a search through several hundred files and find the one desired.  Therefore I 
need to be able to search 

the contents of hundreds of files residing in an Archive Folder for a specific 
string such as PO number. 

Once found, I would then open the specific file automatically for review by the 
user. 



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.  



Hopefully this better explains my requirement.   



Thanks, 

-Bob 







----- Original Message ----- 
From: "MikeB" <[email protected]> 
To: "RBASE-L Mailing List" <[email protected]> 
Sent: Tuesday, November 10, 2009 9:17:29 AM GMT -06:00 US/Canada Central 
Subject: [RBASE-L] - Re: Searching for file contents 

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