[2005] Read values from .txt file
I have an RS232 text file read and stored to my hard drive.
My problem is now about how can i take the values from the line 6, 7 and 8 and ignore the rest ?
Can i define a "dictionary" of ignored (first 5 lines) and some strings (like "O2 % .... ") ?
*** TELEGAN ***
TEMPEST 100 V3.3
DATE 10-03-08
TIME 12:57:59
NETT C -1
O2 % .... 20.9
XAIR O2 > 20%
CO ppm ..... 0
Re: [2005] Read values from .txt file
Create a StreamReader and call ReadLine 5 times, then 3 more. Ignore the results of the first 5 reads and keep the next 3.
- or -
Call File.ReadAllLines to get the file contents into a String array, then get the elements at indexes 5, 6 and 7.