
CODE: [Copy to clipboard]sed 下载地址:http://www.student.northpark.edu/pemente/sed/gsed407x.zipsed -e "/\[name\]:/,/\[.*\]:/{/^ *[^[]/d}" -e "/\[name\]:/rb.txt" a.txt
| Quote: | |
|
CODE: [Copy to clipboard][ Last edited by namejm on 2007-1-25 at 12:54 PM ]@echo off
cd.>test.txt
for /f "tokens=1* delims=:" %%i in ('findstr /n . a.txt') do (
if not "%%j"=="[name]:" (>>test.txt echo %%j) else (
set line=%%i&goto insert
)
)
:insert
>>test.txt echo [name]:
>>test.txt type b.txt
>>test.txt echo.
set flag=1
for /f "skip=%line% delims=" %%i in (a.txt) do (
if "%%i"=="[thing]:" set flag=
if not defined flag >>test.txt echo %%i
)
)
start test.txt
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |