Alternativelly to solution #1 by
Richard MacCutchan[
^] solution, you can use:
1.
CsvHelper[
^]
2.
A Fast CSV Reader[
^]
You can read all lines from text file and split them by any delimiter using Linq. How?
File.ReadAllLines Method (System.IO) | Microsoft Docs[
^]
String.Split Method (System) | Microsoft Docs[
^]
Anonymous Types (Visual Basic) | Microsoft Docs[
^]
Dim filename As String = "file.txt"
Dim lines As String() = File.ReadAllLines(filename)
Dim data = lines _
.Select(Function(l) New With _
{ _
.Id = l.Split(New String(){" "}, StringSplitOptions.RemoveEmptyEntries)(0), _
.Stu_no = l.Split(New String(){" "}, StringSplitOptions.RemoveEmptyEntries)(1), _
.Dt = l.Split(New String(){" "}, StringSplitOptions.RemoveEmptyEntries)(2), _
.Tm = l.Split(New String(){" "}, StringSplitOptions.RemoveEmptyEntries)(3) _
}) _
.ToList()
For Each d In data
Next d
Note: i have never used
MSFlexGrid
, so you have to change the code to your needs...