Vladimir Gajic

Vladimir Gajic

  • NA
  • 57
  • 12k

Reading measurement values from a textfile

Aug 20 2013 6:31 AM
Hello@all

I'm quite a C#-beginner. Currently, I'm working on an application for evaluating light measurements. That means, I have to read simple text files containing measurement-data in the following manner:

;MEASUREMENT
;Wave    Value
340    5.48517
341    5.7362
342    6.04807
343    6.31996
344    6.68566
and so on...

My application needs only the Value-component which should be stored into a double array for further calculations. Basically, the whole thing should work something like this (if I'm thinking right)
1. Open a text file using the FileOpen-Dialog
2. Open a Streamreader to read the selected file
3. Ignore anything that is not a number
4. Ignore the Wave-values
5. Store the rest into an string array and convert it to double

I would be grateful for any hints.
Thanks in advance

Vladimir

 

Answers (15)