Hi Team,
In a text file can we Read both line one go. in excel we have offset Option.
Read both line and take Action.
If InStr(strline, "Rejected") > 0 And InStr(Nextline, "Error") > 0 Then
end if
Sub test()
Dim fso As Scripting.FileSystemObject
Dim tsTxtFile As Scripting.TextStream
Dim strline As String
Set fso = New Scripting.FileSystemObject
Set tsTxtFile = fs
penTextFile("C:\test\test.txt", ForReading, False, TristateMixed)
With tsTxtFile
Do Until .AtEndOfStream
strline = tsTxtFile.ReadLine
If InStr(strline, "Rejected") > 0 And InStr(Nextline, "Error") > 0 Then ' Nextline is offset
End If
Loop
Thanks
mg
In a text file can we Read both line one go. in excel we have offset Option.
Read both line and take Action.
If InStr(strline, "Rejected") > 0 And InStr(Nextline, "Error") > 0 Then
end if
Sub test()
Dim fso As Scripting.FileSystemObject
Dim tsTxtFile As Scripting.TextStream
Dim strline As String
Set fso = New Scripting.FileSystemObject
Set tsTxtFile = fs

With tsTxtFile
Do Until .AtEndOfStream
strline = tsTxtFile.ReadLine
If InStr(strline, "Rejected") > 0 And InStr(Nextline, "Error") > 0 Then ' Nextline is offset
End If
Loop
Thanks
mg