- @echo off&setlocal enabledelayedexpansion
- (for /f "delims=" %%a in ('findstr /n .* 1.txt') do (
- set "str=%%a"
- if not "!str:LIKE '%%=!"=="%%a" (
- if not defined n (
- for /f "tokens=2 delims='%%" %%b in ("%%a") do set "n=%%b"
- set /a m=1!n!+1
- )
- for /f "tokens=1,2" %%c in ("!n! !m:~-4!") do set "str=!str:%%c=%%d!"
- )
- echo,!str:*:=!
- ))>tmp
- move tmp 1.txt
复制代码
|