我正在尝试从文本文件中替换 3 个文本。我试过这个 -
Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("W:\Test.txt", ForReading)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, "Aron_", "Lori_")
strNewText1 = Replace(strText, "Aron", "Jason") 'Not working
strNewText2 = Replace(strText, "Sketa", "Skicia") 'Not working
Set objFile = objFSO.OpenTextFile("W:\Test.txt", ForWriting)
objFile.WriteLine strNewText
objFile.WriteLine strNewText1 'Not working
objFile.WriteLine strNewText2 'Not working
objFile.Close
我无法弄清楚如何进行多次替换。代码非常适合单个替换功能,但不超过一个......请帮助