Hello, first of all I am new to vb.net so sorry if my question is stupid... :(
I have text files that are something like this:
"#......
"#......
1.2 2.5
3.4 5.6
4.8 8.9
.
.
.
Now I would like to add to the first column of the datagridview the first column of the text file (1.2, 3.4, 4.8) and on the second column of the dgv the second column of the text. But without importing the first lines with #....
my code so far is something like this:
Using stream As System.IO.FileStream = System.IO.File.OpenRead("FilePath")
Using reader As New System.IO.StreamReader(stream)
Dim line As String = reader.ReadLine()
Dim FirstCharacter As String = reader.ReadLine(0)
Dim lines As String() = IO.File.ReadAllLines("FilePath")
MsgBox(FirstCharacter)
MsgBox(line)
MsgBox(lines.Length)
While line IsNot Nothing
Dim columns = line.Split(" ")
line = reader.ReadLine()
Dim index = Me.DataGridView1.Rows.Add()
Me.DataGridView1.Rows(index).SetValues(columns)
End While
End Using
End Using
Thank you very much in advance.. :)