- Dim strFile: strFile = "urfile"
- Dim FSO: Set FSO = CreateObject("Scripting.FileSystemObject")
- Dim objFile: Set objFile = FSO.OpenTextFile(strFile)
- Dim strContent: strContent = objFile.Readall
- objFile.Close
-
- strContent = RegExp(strContent, ",", chr(124))
- strContent = RegExp(strContent, "([\d])[|]([\d])", "$1" & chr(44) & "$2")
-
- Function RegExp(str1, patrn, replStr)
- Dim regEx
- Set regEx = New RegExp
- regEx.Pattern = patrn
- regEx.IgnoreCase = True
- regEx.Global = True
- RegExp = regEx.Replace(str1, replStr)
- End Function
-
- Dim objTextFile: Set objTextFile = FSO.CreateTextFile("op.txt")
- objTextFile.Write strContent
- Wscript.Quit
复制代码
[ 本帖最后由 asnahu 于 2011-1-28 15:55 编辑 ] |