- @echo off
- set info=互助互利,支付宝扫码头像,感谢赞助
- rem 有问题,可加QQ956535081及时沟通
- title %info%
- cd /d "%~dp0"
- set "input=list.txt"
- set "output=result.txt"
- powershell -NoProfile -ExecutionPolicy bypass ^
- $text=[IO.File]::ReadAllLines('%input%',[Text.Encoding]::Default);^
- $fs=New-Object System.IO.FileStream('%output%', [System.IO.FileMode]::Create);^
- $sw=New-Object System.IO.StreamWriter($fs, [Text.Encoding]::Default);^
- for($i=0;$i -lt $text.count;$i++){^
- $m=[regex]::match($text[$i].trim(),'^^([^^\s\d]+)\s*?(\d+)');^
- if($m.success){^
- $sw.WriteLine($m.groups[2].value+\"`t\"+$m.groups[1].value);^
- }else{^
- $m=[regex]::match($text[$i].trim(),'^^(\d+)\s*?([^^\s\d]+)');^
- if($m.success){$sw.WriteLine($m.groups[1].value+\"`t\"+$m.groups[2].value)};^
- };^
- };^
- $sw.Close();$fs.Close();
- echo;%info%
- pause
复制代码
|