- @echo off
- cd /d "%~dp0"
- for /f "useback tokens=1 delims=[]" %%a in (`find /n "bcdefg" ^<"000.txt"`) do (
- set _"%%a"=1
- )
- (for /f "useback tokens=1* delims=[]" %%a in (`find /n /v "" ^<"000.txt"`) do (
- if "%%b" neq "" (
- if defined m (
- set str=%%b
- setlocal enabledelayedexpansion
- if "!str:~0,3!" equ " " (
- echo !str!
- endlocal
- ) else (
- endlocal
- set m=
- )
- )
- if defined _"%%a" (
- set m=1
- )
- )
- ))>out.txt
- pause
复制代码
|