本帖最后由 pcl_test 于 2016-7-3 20:38 编辑
- //&cls&dir /a-d/b *.txt|cscript -nologo -e:jscript "%~f0"&pause&exit
- var fso=new ActiveXObject('Scripting.Filesystemobject');
- var n=4, t={}; //指定第4列
- while(!WSH.StdIn.AtEndOfStream){
- var f = fso.OpenTextFile(WSH.StdIn.ReadLine(), 1);
- while(!f.AtEndOfStream){
- var line = f.ReadLine().split(/\s+/);
- if(line != ''){
- if(!line[n-1])line[n-1]='*';
- t[line[0]]=t[line[0]]?t[line[0]]+' '+line[n-1]:line[n-1];
- }
- }
- }
- for(var i in t)WSH.echo(i+' '+t[i]);
复制代码
|