Hi,
here's my code
Open (txtpath.Text) For Input As #1
Open "a:\temp.txt" For Output As #2
sSearch = txtSstr.Text
isearch = Len(sSearch)
sreplace = txtRstr.Text
ireplace = Len(sreplace)

Line Input #1, sInput
Do
iPos = InStr(1, sInput, sSearch)
If (iPos <> 0) Then
iCount = iCount + 1
sInput = Right(sInput, Len(sInput) - iPos)

Else
Line Input #1, sInput

End If

Loop While (Not EOF(1))

lblIcount.Caption = "The total of strings found and replaced = " & CInt(iCount)

Close #1
Close #2

it seems that the loop exits before reading the last line, I've tried moving the EOF to the do but it does the same thing, and help would be apprecated.