How can I get Streamreader to read file to specific row/column? For example:
I want this to insert read txt file starting at second row and second column.
I want this to insert read txt file starting at second row and second column.
Code:
Using sr As New StreamReader(File.Open(FileNameOnly, FileMode.Open))
Try
Dim g As DataGridView = MyActiveSheet.Grid
ClearRows()
Dim TextLine As String = ""
Dim SplitLine() As String
Do While sr.Peek() <> -1
TextLine = sr.ReadLine()
SplitLine = Split(TextLine, ";")
g.Rows.Add(SplitLine)
Loop
Catch ex As EndOfStreamException
'Catch any errors because file is incomplete
End Try
End Using