Parsing a .ini file

 ̄綄美尐妖づ 提交于 2019-12-02 05:04:55

http://www.robvanderwoude.com/sourcecode.php?src=readini_nt

Could you check if this will do the work?

EDIT: this is not tested:

break >new.ini
set skip_this_section=[something]
set skip_flag=0
for /f  %%I in (myini.ini) do (
   call :print_to_file %%I
)
goto :eif

:print_to_file
setlocal enabledelayedexpansion 
    set line=%1
    set first_char=!line:~0,1!
    if "!first_char!" EQU "[" (
        if "!line!" EQU "!skip_this_section!" (
           set skip_flag=1
        ) else (
           set skip_flag=0
        )
    )
endlocal & set skip_flag=%skip_flag%
if %skip_flag% EQU %0% (
   echo %1 >> new.ini
) 

There is an CLI crudini to manipulate ini entries by group and key:

https://github.com/pixelb/crudini/blob/master/EXAMPLES

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!