1

i am working with msbuild script.i want to comment particular line using regular expression in msbuild .pls help me to solve this issue??please give one example other than editing version using regular expression

Nithin
  • 921
  • 3
  • 10
  • 17

1 Answers1

0

You can do this using FileUpdate MSBuild Community Tasks:

FileUpdate
Replace text in file(s) using a Regular Expression

<ItemGroup>
   <FilesToBeUpdated Include="/Output/test.xml" />
</ItemGroup>

<FileUpdate
   Files="@(FilesToBeUpdated)"
   Regex="..."
   ReplacementText="..." />
sll
  • 61,540
  • 22
  • 104
  • 156
  • suppose i have file test.xml .then i want to comment line "how r u " in that xml.how can i implent this using msbuild? – Nithin Oct 19 '11 at 10:21
  • @Nithin : you have provide valid regex this is an other question I believe, not MSBuild specific – sll Oct 19 '11 at 10:39