Forum Discussion
AlexanderM
15 years agoStaff
Hi Christophe,
The variant you offered is incorrect. Here is an example demonstrating how to do this:
Sub Main
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Test\File.XML", 1)
strText = objFile.ReadAll
objFile.Close
Log.Message(strText)
Set RegExpr1 = HISUtils.RegExpr
' Note that the ^ and $ symbols have been removed
RegExpr1.Expression = "<M_CODE>(.+)</M_CODE>"
strNewText = RegExpr1.Replace(strText, "")
Log.Message(strNewText)
Set objFile = objFSO.OpenTextFile("C:\Test\File.XML", 2)
objFile.WriteLine strNewText
objFile.Close
End Sub
Does it help you?
Related Content
- 5 years ago
- 4 years ago
- 8 years ago
Recent Discussions
- 2 days ago