- :on error resume next
- :sub class_bat
- echo off&cls
- cscript -nologo -e:vbs "%~0"
- pause
- exit sub
- :end sub
- dim file(1),list(1),result(1)
- set fso=createobject("scripting.filesystemobject")
- set regexp=new regexp
- File(0)="1.txt"
- File(1)="2.txt"
- regexp.global=-1:regexp.ignorecase=-1
- regexp.pattern="[\u4e00-\u9fff0\w]* *([\u4e00-\u9fff0\w]*)"
- for i=0 to 1
- read=fso.opentextfile(File(i)).readall
- list(i)=RegExp.Replace(read,"$1")
- result(i)=split(list(i),vbcrlf)
- next
- redim s(ubound(result(0)))
- for j=0 to ubound(result(0))
- s(j)=result(0)(j)&chr(32)&result(1)(j)
- next
- change=join(s,vbcrlf)
- wsh.echo "演示结果:"
- fso.createtextfile("new_result.txt").write change
- wsh.echo change
- set fso=nothing:set regexp=nothing
复制代码
|