本帖最后由 pcl_test 于 2015-8-26 14:37 编辑
第三方- ::先下载http://batch-cn.qiniudn.com/tool/gawk.exe
- @gawk "{a[$4]++}END{for(i in a)if(a[i]>1)print i,a[i]}" "1.txt">"2.txt"
复制代码 bat+js,保存为bat运行- @if(0)==(0) echo off&cscript -nologo -e:jscript "%~0"<"1.txt">"2.txt"&pause & exit/b&@end
- var a = {};
- while(!WScript.StdIn.AtEndOfStream) {
- var m = WScript.StdIn.ReadLine().split(/\s+/);
- a.hasOwnProperty(m[3])?(a[m[3]]++):a[m[3]]=1;
- }
- for (var i in a){if (a[i]>1)WSH.Echo(i+' '+a[i]);}
复制代码
|