本帖最后由 zaqmlp 于 2019-5-10 21:57 编辑
- @echo off
- set info=互助互利,支付宝扫码头像,感谢赞助
- rem 有问题,可加QQ956535081及时沟通
- title %info%
- cd /d "%~dp0"
- set "output=结果"
- md "%output%" 2>nul
- powershell -NoProfile -ExecutionPolicy bypass ^
- $files=@(dir *.txt^|?{$_ -is [System.IO.FileInfo]});^
- for($i=0;$i -lt $files.length;$i++){^
- write-host $files[$i].Name;^
- $text=[IO.File]::ReadAllText($files[$i].FullName, [Text.Encoding]::UTF8);^
- $newtext=[regex]::replace($text,'-?\d+(?=\.\d+\.\d+)',{param($a);[int]$a.value+2697;});^
- [IO.File]::WriteAllText(('%output%\'+$files[$i].Name), $newtext, [Text.Encoding]::UTF8);^
- };^
- write-host '%info%' -ForegroundColor green;
- pause
复制代码
|