这次应该全部合楼主的题意了吧!
- @echo off&setlocal enabledelayedexpansion
- (for /f "tokens=*" %%a in ('findstr /n .* a.txt') do (
- set abc=%%a
- set str=!abc:*:=!
- if not defined str set kon=y
- for /f "tokens=* delims= " %%b in ("!str!") do (set str=%%b
- for %%c in (abc 123 456) do (if "!str:~,3!" equ "%%c" set str=)
- if defined str (
- set res=
- for %%c in (!str!) do set res=!res! %%c
- if defined res (
- if defined kon echo;
- echo;!res:~1!
- set kon=
- )
- ) else (
- if "%%b" equ "" (set kon=y) else (
- if defined kon echo;
- echo;!abc:*:=!
- set kon=
- )
- )
- )
- ))>a_2.txt
- start a_2.txt
复制代码
|