Not sure if this is what you need but to read a basic text file is an exercise in looping. This is some simple code I started using early in my coding career, it is simple but not robust.
This is the main bit of code, you send it a datatable that you want the text file information put into and the name of the file you want to read. It will place each semicolon separated string into a column of the datatable.
Important: the datatable sent must have at least 1 column for each segment in the file.
Private Sub ReadFile(sTable As DataTable, sFileName As String)
Dim line As String
Dim file As New System.IO.StreamReader(Application.StartupPath + "\" + sFileName)
line = file.ReadLine()
While (line) IsNot Nothing
Dim tmpline As String = line
Dim tmpStrings As String()
Dim tmpRow As DataRow = sTable.NewRow()
Dim i As Integer = 0
While tmpline.Length > 0
tmpStrings = NextLine(tmpline)
tmpline = tmpStrings(1)
tmpRow(i) = tmpStrings(0)
i += 1
End While
sTable.Rows.Add(tmpRow)
line = file.ReadLine()
End While
file.Close()
End Sub
And here is the NextLine Function:
Private Function NextLine(line As String) As String()
Dim tmpString As String() = New String(1) {}
tmpString(0) = line.Substring(0, line.IndexOf(";"))
tmpString(1) = line.Substring(line.IndexOf(";") + 1, line.Length - (line.IndexOf(";") + 1))
Return tmpString
End Function