469,076 Members | 1,340 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,076 developers. It's quick & easy.

Reading from a text file


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
Sep 12 '08 #1
2 869
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.

"cmdolcet69" <co************@hotmail.comwrote in message
news:d2**********************************@m45g2000 hsb.googlegroups.com...
>
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
Sep 13 '08 #2
"cmdolcet69" <co************@hotmail.comschrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Sep 13 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by fabrice | last post: by
19 posts views Thread by Lionel B | last post: by
50 posts views Thread by Michael Mair | last post: by
2 posts views Thread by Sabin Finateanu | last post: by
4 posts views Thread by Amit Maheshwari | last post: by
3 posts views Thread by The Cool Giraffe | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.