我自己整的只能显示最后一组标签的相关内容, 前面的被忽略掉了:
FOLDER
%ProgramFiles%\Internet Explorer
代码如下:- @echo off
- setlocal EnableDelayedExpansion
- for /f "delims=[]" %%a in ('findstr "^\[" a.txt') do set opt=%%a
- for /f "delims=:" %%i in ('findstr /in "!opt!" a.txt') do set n=%%i
- for /f "skip=%n% delims=" %%i in ('type a.txt') do (
- set "str=%%i"
- if not "!str:~0,1!"=="[" (echo !opt!&echo !str!) else (
- pause
- goto :eof
- )
- )
- pause
复制代码 怎么能分别输出INI的所有有效行?? |