How can I load the contents of a text file into a batch file variable?

前端 未结 6 1734
小鲜肉
小鲜肉 2020-12-07 19:12

I need to be able to load the entire contents of a text file and load it into a variable for further processing.

How can I do that?


Here\'s what I di

6条回答
  •  天涯浪人
    2020-12-07 19:50

    You can use:

    set content=
    for /f "delims=" %%i in ('type text.txt') do set content=!content! %%i
    

提交回复
热议问题