okay GOTCHA !!!
check this new line of code
Private Sub Command1_Click()
Dim fso As FileSystemObject
Dim tsA As TextStream
Dim tsB As TextStream
Set fso = New FileSystemObject
Set tsA = fso.OpenTextFile(App.Path & "\a.txt", ForReading)
Set tsB = fso.OpenTextFile(App.Path & "\b.txt", ForWriting, True)
While Not tsA.AtEndOfStream
s = tsA.ReadLine
Rem NEW CODE
If Mid$(s, 1, 2) = "04" Then
Rem OLD CODE s1 = Replace(s, "eee", "")
s2 = Left(s, Len(s) - 3)
tsB.WriteLine (s2)
Else
tsB.WriteLine (s)
End If
Wend
tsA.Close
tsB.Close
Set fso = Nothing
MsgBox "Done"
End Sub
I guess, this code make some sense to your requirement?
hope this helps.
With Regards,
Raghavendra Mudugal
|