- Set objFSO = CreateObject("Scripting.FileSystemObject")
- Set objFile = objFSO.OpenTextFile("test.txt", 1)
- colLines = objFile.ReadAll
- objFile.Close
-
- Set objRegEx = CreateObject("VBScript.RegExp")
- objRegEx.Global = True
- objRegEx.IgnoreCase = True
- objRegEx.Pattern = "\s*,"
-
- colLines = objRegEx.Replace(colLines, ",")
-
- Set objFile = objFSO.OpenTextFile("test.txt", 2)
- objFile.Write colLines
- objFile.Close
-
- Set objFSO = Nothing
- Set objRegEx = Nothing
复制代码
|