本帖最后由 Nsqs 于 2016-4-28 15:27 编辑
- :On Error Resume Next
- set fso=CreateObject("scripting.filesystemobject")
- :Sub bat
- echo off&cls
- cscript -nologo -e:vbs "%0"
- pause
- Exit Sub
- :End Sub
- set RegExp=new RegExp
- set stdin=wscript.stdin
- RegExp.IgnoreCase=1:RegExp.Global=1
- file="1.txt"
- RegExp.Pattern="[^\u4e00-\u9fff0\da-z。,?:“”]"
- var=fso.opentextfile(file).readall
- var=RegExp.Replace (var,empty)
- RegExp.Pattern="(\W{15})"
- var=RegExp.Replace (var,"$1"&vbcrlf)
- fso.createtextfile("new_"&file).write var
- wsh.echo var
复制代码
|