how to replace string in file using msbuild?

后端 未结 8 2100
庸人自扰
庸人自扰 2020-12-01 09:05

I want to replace a string such \"how r u\" in file test.xml with a string \"i am fine\" in another file xy.xml.using regular expression in ms build.

ie i have to r

8条回答
  •  甜味超标
    2020-12-01 09:49

    There is very simple approach to just replace string in a file:

      
          
              c:\input.txt
              c:\output.txt
          
          
      
    

    See https://docs.microsoft.com/en-us/visualstudio/msbuild/property-functions?view=vs-2019 to explore inlinable C# code. [System.Text.RegularExpressions.Regex] included into the list.

提交回复
热议问题