Hey,
I would need help to use a SteamReader in order to read a file text and display some lines in a DataGridView.
This file text looks like this
![Name: Capture5.jpg
Views: 63
Size: 21.7 KB]()
Columns of the DataGridView will be "nb / length / mass[g.mol] / Chain / Details"
I'm reading the file line by line and trying to catch just those lines
![Name: Capture6.PNG
Views: 58
Size: 5.9 KB]()
Here is the code that i'm trying to do, I don't really know if using a StreamReader with a loop until the end of file is a good idea, and I'm not able to get only lines that I need.
I will join the file text if someone can give me help.
Thank you.
test.txt
I would need help to use a SteamReader in order to read a file text and display some lines in a DataGridView.
This file text looks like this
Columns of the DataGridView will be "nb / length / mass[g.mol] / Chain / Details"
I'm reading the file line by line and trying to catch just those lines
Here is the code that i'm trying to do, I don't really know if using a StreamReader with a loop until the end of file is a good idea, and I'm not able to get only lines that I need.
I will join the file text if someone can give me help.
Code:
Do Until reader.EndOfStream
' getLines = reader.ReadLine()
If reader.ReadLine.Contains("Code") And reader.EndOfStream = False Then
reader.ReadLine()
reader.ReadLine()
test = reader.ReadLine.Substring(1, 11)
Else
' reader.ReadLine()
End If
dt_sum_protamex.Rows.Add(test)
Loop
test.txt