本帖最后由 qixiaobin0715 于 2022-4-14 11:36 编辑
未测试:- @echo off
- setlocal enbledelayedexpansion
- (for /f "delims=" %%a in (1.txt) do (
- set str=%%a
- if "!str:~,1!"=="[" (
- if "%%a"=="[config]" (
- set n=true
- ) else (
- set n=
- )
- ) else if defined n (
- echo,%%a
- )
- ))>2.txt
- pause
复制代码
|