本帖最后由 pcl_test 于 2016-7-18 13:54 编辑
- //&cls&cscript -nologo -e:jscript "%~f0"<"查询成功.txt"&pause&exit
- var fso = new ActiveXObject('Scripting.FileSystemObject'), a={};
- while(!WSH.StdIn.AtEndOfStream){
- var line = WSH.StdIn.ReadLine();
- var m = line.match(/\s(浙江|江西|福建)\s/);
- if(m){
- var str = line.split(/\s+/);
- a[m[1]]?a[m[1]]+=str[0]+'\r\n':a[m[1]]=str[0]+'\r\n';
- }
- }
- for(var b in a)fso.OpenTextFile(b+'.txt', 2, true).Write(a[b])
- WSH.Echo('Done');
复制代码
|