how to replace string in file using msbuild?

后端 未结 8 2099
庸人自扰
庸人自扰 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:39

    I ran the both replacements against same file that sits on a Unix drive and used the unc path to it \server\path...:

    
    
    
    
    

    and the cs custom action above does not add the bom; however the FileUpdate did:

    %head -2 branding.h branding2.h
    ==> branding.h <==
    #/* branding.h
    #** This file captures common branding strings in a format usable by both sed and C-preprocessor.
    
    ==> branding2.h <==
    #/* branding.h
    #** This file captures common branding strings in a format usable by both sed and C-preprocessor.
    

    Thanks csharptest.net - I was doing doing exec's with perl subtitute commands for unix builds.

提交回复
热议问题