C
C
Older programs produce output files in their own ways, and they have
to be read by new programs, so I am trying to figure out how best to
read some of the older files.
Suppose the first line in the file is
8 3 0.3452348E-04 "left side"
The first two are always integers, followed by a single precision
floating point number, followed by a string (in quotes if there are
blanks inside, and without quotes if it is a single word). In VB6, I
could write Input #1, N, M, x1, varname
Then the next three lines contain an 8 by 3 matrix of floating point
numbers. The number of blank spaces in between the fields vary since
they have been written by Print statements in VB6.
I wonder if there is a good way of reading these files in VB.net.
The inefficient way I can think of is to read blanks, then collect the
string one character at a time, convert to expected type and continue
that way. If you hit a quote, then stop looking for blanks until quote
ends. But this looks so inefficient and will require 40 lines of code
to do what we earlier did in one simple statement.
I have started to learn VB.net just last week, so I will have more
stupid questions.
to be read by new programs, so I am trying to figure out how best to
read some of the older files.
Suppose the first line in the file is
8 3 0.3452348E-04 "left side"
The first two are always integers, followed by a single precision
floating point number, followed by a string (in quotes if there are
blanks inside, and without quotes if it is a single word). In VB6, I
could write Input #1, N, M, x1, varname
Then the next three lines contain an 8 by 3 matrix of floating point
numbers. The number of blank spaces in between the fields vary since
they have been written by Print statements in VB6.
I wonder if there is a good way of reading these files in VB.net.
The inefficient way I can think of is to read blanks, then collect the
string one character at a time, convert to expected type and continue
that way. If you hit a quote, then stop looking for blanks until quote
ends. But this looks so inefficient and will require 40 lines of code
to do what we earlier did in one simple statement.
I have started to learn VB.net just last week, so I will have more
stupid questions.