SEARCHING .TXT for information

b8tovene

New Member
Our orangization has daily reports which contain numbers I would like to use for the purpose of E-mail notifications Etc.

I was wondering if it's possible to simply search this [report formatted] text document for certain numbers Etc. by calling it into progreess?

For example:

SAMPLE REPORT

Company # of Widgets
----------------------------------------------------------------------
XYZ 23

ABC Inc. 52

Widgetronics 75

What I'd like to do is search this txt file for these numbers, so I can update an excel spreadsheet and E-mail those numbers to the clients. Any ideas?


Thanks
 

cup99

New Member
You can do what you want.

All you need to do is use the INPUT command. This will allow you to read a file into Progress a line at a time and then search the line of text for your numbers.

For example:

DEFINE VARIABLE vData AS CHARACTER NO-UNDO.

INPUT FROM "c:\samplereport.txt".

REPEAT:
IMPORT UNFORMATTED vData.
MESSAGE vData.
END.

INPUT CLOSE.


What the code does is read the file one line at a time and puts the text into the vData variable. You can then search the vData variable to check if it contains any numbers.
 

Cindy Umemoto

New Member
How can this code be changed to find a given string in the file and grab data say 5 spaces after the string occurs (like 'ERROR:'). For ex..
ERROR: This is error message I want to get
 
Top