Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Scripts\123.txt", ForReading)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, "043487835", "04-3487835")
strNewText = Replace(strText, "5551234", "5551235")
Set objFile = objFSO.OpenTextFile("C:\Scripts\123.txt", ForWriting)
objFile.WriteLine strNewText
objFile.Close |