|
-
Nov 20th, 1999, 01:10 AM
#1
Thread Starter
Junior Member
I need to extract some data from a log file which has a known format produced by another programme.
The data I need is contained in lines 11, 27, 47 etc (increasing from 11 in multiples of 18).
These lines have a common structure relating the item processed and various properties eg
"ITEM 1 PROPERTY A","PROPERTY VALUE"
"ITEM 1 PROPERTY B","PROPERTY VALUE"
"ITEM 1 PROPERTY C","PROPERTY VALUE"
"ITEM 1 PROPERTY D","PROPERTY VALUE"
"ITEM 2 PROPERTY A","PROPERTY VALUE"
"ITEM 2 PROPERTY B","PROPERTY VALUE"
"ITEM 2 PROPERTY C","PROPERTY VALUE"
"ITEM 2 PROPERTY D","PROPERTY VALUE" etc.
Currently I read EACH line, check for the required property using string compare on the part of the line containing the property name and if true extract the property value.
Is there a better way to do this checking only those lines that I know corrrespond to the data I want to extract as I have not been able to figure one out.
Peter Brown
-
Nov 20th, 1999, 02:52 AM
#2
to skip a line :
line input #MyFileNumber, StringVar 'ignores this line because the next overwrites it immediately:
line input #MyFileNumber, StringVar
so:
do until eof(MyFileNumber)
for jj = 0 to 9
line input #MyFileNumber, StringVar
next jj
line input #MyFileNumber, StringVar
if StringVar ...'analyse the string or whatever... then...end if
loop
the above code skips 10 lines and uses the 11th for whatever purpose you intended. ok?
contact me for help.
Woss the .txt file expert, (yeah right!)
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Wossname,
Email me: [email protected] 
[This message has been edited by wossname (edited 11-20-1999).]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|