- //&cls&dir /a-d/b *.txt|cscript -nologo -e:jscript "%~f0"&pause&exit
-
- var fso = new ActiveXObject('Scripting.Filesystemobject');
- var s='';
- while(!WSH.StdIn.AtEndOfStream){
- var file = WSH.StdIn.ReadLine();
- try{
- var arr={};
- var str = fso.OpenTextFile(file, 1).ReadAll().split('-');
- for(var i=0; i<str.length; i++){
- arr[str[i]]?arr[str[i]]++:arr[str[i]]=1;
- if(arr[str[i]] >= 6){
- s+=fso.GetFile(file).Name+'|'+str[i]+'\r\n';
- break;
- }
- }
- arr=null;
- }catch(e){}
- }
- WSH.Echo(s);
复制代码
|