I'm trying to parse a text file (actual TXT Text File: 150 MB), and when using StreamReader to do a 'ReadLine', the last line I get when either using "if line is nothing" or "if sr.EndfStream" is at row 2,486.
When importing it into Excel though, I'm getting over 17,000 rows.
What am I doing wrong?
Try
Dim TempDT As New DataTable
Dim LineCount As Int32
TempDT.Columns.Add("One")
' Create an instance of StreamReader to read from a file.
Using sr As StreamReader = New StreamReader(f.T5_txtPathAndFileName.Text)
Dim line As String
' Read and display the lines from the file until the end
' of the file is reached.
Do
line = sr.ReadLine()
If line IsNot Nothing Then
TempDT.Rows.Add(line)
End If
LineCount += 1
Loop Until line Is Nothing
End Using
Return TempDT
Catch ex As Exception
End Try
Please help
Newbie