相关疑难解决方法(0)

多行文本文件,如何放入环境变量

我有一个名为file.txt的文件,其中包含:

     this is line one ^
     this is line two ^
     this is the last line
Run Code Online (Sandbox Code Playgroud)

我怎么能把它变成env var?

我可以从批处理文件中执行此操作: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!
Run Code Online (Sandbox Code Playgroud)

这输出三行:

      Line 1
      Line 2
      Last line
Run Code Online (Sandbox Code Playgroud)

那么如何在批处理文件中将file.txt导入envvar?

batch-file multiline

5
推荐指数
1
解决办法
9182
查看次数

标签 统计

batch-file ×1

multiline ×1