- @echo off
- set info=互助互利,支付宝扫码头像,感谢赞助
- rem 有问题,可加QQ956535081及时沟通
- title %info%
- start mshta VBScript:Execute("msgbox(""%info%""):close")
- cd /d "%~dp0"
- set "文件1=a.txt"
- set "文件2=tmp.txt"
- set "文件3=b.txt"
- powershell ^
- $t1=@(gc '%文件1%' -enc UTF8);^
- $t2=@(gc '%文件2%' -enc UTF8);^
- $dic=New-Object 'System.Collections.Generic.Dictionary[string,string]';^
- [System.Collections.ArrayList]$arr=@();^
- for($i=0;$i -lt $t1.length;$i++){^
- if(-not $dic.ContainsKey($t1[$i].trimend())){$dic.Add($t1[$i].trimend(), '')};^
- };^
- for($i=0;$i -lt $t2.length;$i++){^
- $line=$t2[$i] -split '\t';^
- if($dic.ContainsKey($line[0])){[void]$arr.Add($t2[$i])};^
- };^
- out-file -file '%文件3%' -input ($arr -join \"`r`n\") -enc UTF8;
- pause
复制代码
|