- set fso=CreateObject("Scripting.FileSystemObject")
- set regexp=new regexp
- file="pojie.alf"
- RegExp.Global=-1:RegExp.IgnoreCase=-1
- RegExp.Pattern="\r\n"
- t=timer
- read=fso.opentextfile(file).readall
- set Matches=RegExp.Execute(read)
- wsh.echo "共 "&Matches.Count&" 行, "&timer-t &" 秒"
- set fso=nothing:set Matches=nothing:set regexp=nothing
复制代码 经测试5秒出结果 |