Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extract data from text file 2

Status
Not open for further replies.

krymat

Technical User
Jul 25, 2000
105
How would I get let's say product name from the following text Residing in c:\be\02STAT10.REP??






STATISTICS REPORT



xxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxxx
.
18:16:36 Mar 06, 2001


Line Number: 2
Product Name: 24OZ NOFAT Product Number: 1
Lot Number: 123 Weight Units: Grams

Tare Weight: 0 Grams Label Weight: 713 Grams
Target Weight: 713 Grams

Time of last clear: 16:07:38 Mar 06, 2001
Summary Report End Time: 18:16:36 Mar 06, 2001


CUMULATIVE STATISTICS

Total Count: 13393 Total Weight: 9927355 Grams
Reject Low Count: 56 Reject Low Total Weight: 39445 Grams
Reject High Count: 0 Reject High Total Weight: 0 Grams
Accept Count: 13330 Accept Total Weight: 9882784 Grams


Cumulative Average Weight: 741 Grams
Cumulative Standard Deviation: 719.0

Cumulative Average Weight, accepts only: 741 Grams
 
try something like this

Dim strFieldData As String
Dim strProduct As String

Open "c:\be\02STAT10.REP" For Input As #1
Do While Not EOF(1)
Line Input #1, strFieldData
If Left(strFieldData, 7) = "Product" Then
strProduct = Trim(Mid(strFieldData, 15, 20))
Exit Do
End If
Loop
Close #1


PaulF
 
if this is going to be a reoccurring task, you might want to look into some software called Monarch by a company I think called Math Strategies. You can take reports like this, make a "model" for them and extract the data into a format that you can import into Access.

Just a thought... Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top