473,385 Members | 1,645 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 995
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Suresh Kumaran | last post by:
Hi All, Does anybody know the sytax in VB.NET to write the contents of a multiline text box to a text file? Appreciate help. Suresh
1
by: fabrice | last post by:
Hello, I've got trouble reading a text file (event viewer dump) by using the getline() function... After 200 - 300 lines that are read correctly, it suddenly stops reading the rest of the...
19
by: Lionel B | last post by:
Greetings, I need to read (unformatted text) from stdin up to EOF into a char buffer; of course I cannot allocate my buffer until I know how much text is available, and I do not know how much...
0
by: Eric Lilja | last post by:
Hello, I have a text file that contains a number of entries describing a recipe. Each entry consists of a number of strings. Here's an example file with only one entry (recipe): Name=Maple Quill...
1
by: Magnus | last post by:
allrite folks, got some questions here... 1) LAY-OUT OF REPORTS How is it possible to fundamentaly change the lay-out/form of a report in access? I dont really know it that "difficult", but...
50
by: Michael Mair | last post by:
Cheerio, I would appreciate opinions on the following: Given the task to read a _complete_ text file into a string: What is the "best" way to do it? Handling the buffer is not the problem...
2
by: Sabin Finateanu | last post by:
Hi I'm having problem reading a file from my program and I think it's from a procedure I'm using but I don't see where I'm going wrong. Here is the code: public bool AllowUsage() { ...
4
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any...
4
by: Amit Maheshwari | last post by:
I need to read text file having data either comma seperated or tab seperated or any custom seperator and convert into a DataSet in C# . I tried Microsoft Text Driver and Microsoft.Jet.OLEDB.4.0...
3
by: The Cool Giraffe | last post by:
Regarding the following code i have a problem. void read () { fstream file; ios::open_mode opMode = ios::in; file.open ("some.txt", opMode); char *ch = new char; vector <charv; while...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.