Multiline text file, how to put into an environment variable
问题 i have a file called file.txt which contains: this is line one ^ this is line two ^ this is the last line how can i put that into an env var? i can do this from a batch file: test.bat set LF=^ [blank line] [blank line] rem two blank lines needed above set multi=Line 1!LF!Line 2!LF!Last line echo !multi! this outputs three lines: Line 1 Line 2 Last line so how can i get file.txt into envvar inside a batch file? 回答1: As dbenham said, it can be done also with for/f but it's a bit more