I'm trying to parse a rather large string from a .txt file that breaks
into 2 lines ( the string is a fixed-length string reaching 6694
characters) into a dataset using VB.net. The issues that I am having is
with the line breaks. I am able to parse the string into the dataset up
in till the line breaks. My pattern is as follows..
"^(?<n0>.{1})(?<n1>.{8})(?<n2>.{2})..... (?<n404>.{2})$"
My code is as follows:
Dim re as New Regex(patern)
Dim ma as Match = re.Match(sr.ReadLine(), RegexOptions.MultiLine)
Do while
ma.Groups("n" & i & "").Value.ToString
Loop
My issue is when I hit a line break in the txt file. The reason the
string breaks is that it is so long that it reaches the max places of
the txt file and has to continue on the next line. The beginning of a
new line then begins on the next line .
Example:
I33445 89 u000x00000 900000 x00000 ....... (on and on until the
max length of a txt file).......0000 00000000 (End of Txt file)
TOWN88989 000000000000 909 (end of String)
NEW Line Starts Here.
I have tried different options with RegexOptions but to no avail.
Thank you for your time.