How to read certain line in a txt file, for example to read line 3 or reading from line 3 to 10 ?
Printable View
How to read certain line in a txt file, for example to read line 3 or reading from line 3 to 10 ?
check this link:
Read specific line from text file
or:VB Code:
Dim sLines() As String, N As Long Open "C:\test.txt" For Input As #1 sLines = Split(Input(LOF(1), #1), vbCrLf) Close #1 ' Line 3 (it's 0-based) Debug.Print sLines(2) ' Lines 3 to 10 For N = 2 To 9 Debug.Print sLines(N) Next N