- //&cls&dir /a-d/b *.txt|cscript -nologo -e:jscript "%~f0"&pause&exit
-
- var fso = new ActiveXObject('Scripting.Filesystemobject'), s='';
- function CoutN(file){
- var f = fso.OpenTextFile(file, 1);
- try{
- var txt = f.ReadAll().split(/\r\n/)
- if(/^\s*?keys=(\d+)\s*$/.test(txt[2])){
- var n=RegExp.$1;
- for(var i=3; i<txt.length; i++){
- if(txt[i].length > 5)n++;
- }
- s+=fso.GetFile(file).Name+','+n+'\r\n';
- }
- }catch(e){}
- f.Close();
- }
-
- while(!WSH.StdIn.AtEndOfStream)CoutN(WSH.StdIn.ReadLine());
- WSH.echo(s);
复制代码
|