Reading complex Data from a file

  • Thread starter Thread starter Blue man
  • Start date Start date
B

Blue man

Hello
I have a data file like this :
01 "" "09:04" "PLMDX " 3.20 0.35 1.74 0.23 2.49 0.17
1.37 0.18 03
02 "" "09:05" "PLMDX " 3.70 0.18 1.93 0.14 2.75 0.19
1.05 0.01 03
03...
04...
......
and i want to read each number and fileds and save it to variables to save
it in to the database .
with stream reader and file rader i can only read all of it as a single
string , is that possible to do it with regular expression ? i don't know
how . any idea ...
help please
 
Blue man said:
Hello
I have a data file like this :
01 "" "09:04" "PLMDX " 3.20 0.35 1.74 0.23 2.49 0.17
1.37 0.18 03
02 "" "09:05" "PLMDX " 3.70 0.18 1.93 0.14 2.75 0.19
1.05 0.01 03
03...
04...
.....
and i want to read each number and fileds and save it to variables to save
it in to the database .
with stream reader and file rader i can only read all of it as a single
string , is that possible to do it with regular expression ? i don't know
how . any idea ...
help please

Can't you use the ReadLine() method of StreamReader? It looks like
everything is on a row-by-row, line-by-line basis.

Once you have a line, then you can use a Regex to split it.
Unfortunately String.Split() won't work because of the quotes.

-c
 
Back
Top