- @echo off
- REM 文件路径
- set "txt=123.txt"
- powershell -version 2.0 -c "(Get-Content '%txt%') | foreach {($_ -replace '(?=[^\s])(?<=[^\s])','】【' -replace '(?<=^\s*)','【' -replace '【(?=\s)','') + '】'} | Out-File 'new.txt'"
- pause&exit
复制代码 文字保存为123.txt,ANSI编码
代码保存为bat,ANSI编码
生成new.txt |