只有单字节字符的文本可以这样:- @echo off&setlocal enabledelayedexpansion
- set n=1
- for /f "tokens=1* delims=:" %%a in ('
- "cmd /u /c type 1.txt|more|findstr /n ."
- ') do (
- if %%a neq !n! (
- echo;!str:~1!
- for /l %%b in (!n! 9 %%a) do if %%b neq !n! echo;
- set str=
- )
- set /a n=%%a+1
- set str=!str! %%b
- )
- echo;!str:~1!
- pause
复制代码
|