- @echo off
- rem 批处理和文本全部保存为ansi编码格式
-
- set input=1.txt
- set output=2.txt
-
- cd /d "%~dp0"
- (for /f "useback delims=" %%a in ("%input%") do (
- set str=%%a
- setlocal enabledelayedexpansion
- for /f "tokens=1*" %%x in ("!str:----= !") do (
- endlocal
- set str2=%%x
- set str3=%%y
- setlocal enabledelayedexpansion
- for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do (
- set "str2=!str2:%%i=%%i!"
- )
- echo !str2!----!str3!
- endlocal
- )
- ))>"%output%"
- pause
复制代码
|