本帖最后由 zaqmlp 于 2019-5-19 14:35 编辑
- @echo off
- mode con lines=1000
- set info=互助互利,支付宝扫码头像,感谢赞助
- rem 有问题,可加QQ956535081及时沟通
- title %info%
- cd /d "%~dp0"
- powershell -NoProfile -ExecutionPolicy bypass ^
- [System.Collections.ArrayList]$s=@();^
- dir^|?{($_ -is [System.IO.FileInfo]) -and ($_.Extension -eq '.txt')}^|%%{^
- $text=[IO.File]::ReadAllText($_.FullName, [Text.Encoding]::Default);^
- $m=[regex]::matches($text,'【[^^】]+】');^
- write-host ('---------'+$_.Name+'---------');^
- $dic=New-Object 'System.Collections.Generic.Dictionary[string,string]';^
- foreach($it in $m){^
- if(-not $dic.ContainsKey($it.value)){^
- write-host $it.value;^
- $dic.Add($it.value,'');^
- [void]$s.add($it.value);^
- };^
- };^
- };^
- write-host '=============total=============';^
- $ss=@($s^|sort^|get-unique);$ss;^
- [IO.File]::WriteAllLines('$total.log', $ss, [Text.Encoding]::Default);^
- write-host '%info%' -ForegroundColor green;
- pause
复制代码
|