Reading from a text file

C

cmdolcet69

How can i just parse out the Indicator Readings in a text file so that
i can fill an arraylist with the indicator values

-------------------Indicator Test RAW BIT Values-------------------
Date:09/12/2008
Time:3:20 PM
Username:Colin
Serial Number:0
Version:Empty
Model:5335
Manufactor:LMI


Stage Location Indicator Reading
0 366
0.01 367
0.02 371
0.03 376
0.04 379
0.05 383
0.06 386
0.07 390
0.08 393
0.09 395
0.1 398
0.11 401
 
J

James Hahn

It depends on the characters separating the stage from the reading, but it
seems to me that the distinctive feature is the length of the line and that
the trimmed left half and the trimmed right half are both numeric.
 
H

Herfried K. Wagner [MVP]

cmdolcet69 said:
How can i just parse out the Indicator Readings in a text file so that
i can fill an arraylist with the indicator values

You can use 'System.IO.StreamReader' for this purpose. Just call the
'ReadLine' method until you reach the indicator values (depending on the
file format this may be necessary exactly n times). Then you can read the
values line-by-line and split each line into its parts, which can be added
to the array list. Make sure you check out the 'Trim' and 'Split'
functions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top