How do i search for 2 lines of text in a file? 1 being a starting point and one being an ending point and load the lines inbetween?
Printable View
How do i search for 2 lines of text in a file? 1 being a starting point and one being an ending point and load the lines inbetween?
Code:Dim bRead As Boolean
Dim sFile As String
Open "MyFile" For Input As #1
Do Until EOF(1)
Line Input #1, tmp
If tmp = "My First line" Then bRead = True
If tmp = "My Last Line" Then
bRead = False
Exit Do
End If
If bRead = True Then sFile = sFile & tmp & vbCrLf
Loop
Close #1
Thank ya kindly:p