Find text in file and set it as a variable. Batch file

后端 未结 1 1837
离开以前
离开以前 2021-01-16 09:56

I try to find one line in whole text file. Next I need to set this line as a variable.

When i try do this:

set MY_VARIABLE=findstr /I \"MY_TEX

1条回答
  •  说谎
    说谎 (楼主)
    2021-01-16 10:22

    Almost done

    For command line

    for /F "delims=" %a in ('findstr /I "MY_TEXT" MY.FILE') do set "batToolDir=%a"
    

    For batch file double the percent signs

    for /F "delims=" %%a in ('findstr /I "MY_TEXT" MY.FILE') do set "batToolDir=%%a"
    

    0 讨论(0)
提交回复
热议问题