I think my previous question submission was eaten by a grue. Please disregard this if this is a double post.

Using the 'substitutionList' tag, I can use sed-like regular expressions to match a single line of text in a file. However, I have been unable to determine a way to match a text pattern that covers more than one line of text. Is this possible with the Installer Builder, and if so, how?

Thanks, - Stephen Kiazyk

asked 15 Jun '12, 13:53

stephenkiazyk's gravatar image

stephenkiazyk
1111
accept rate: 0%


It is not possible to use the <substitute> action for this. All of the lines are parsed and replaced individually.

However, you can use <readFile>, <setInstallerVariableFromRegEx> and <writeFile> to perform the same thing. The <setInstallerVariableFromRegEx> action allows performing mapping of multi-line regular expressions.

<readFile> <name>contents</name> <path>/path/to/file</path> </readFile> <setInstallerVariableFromRegEx> <name>contents</name> <pattern>Multi line replacement</pattern> <substitution>Multiline replacement as single line</substitution> <text>${contents}</text> </setInstallerVariableFromRegEx> <writeFile> <path>/path/to/file</path> <text>${contents}</text> </writeFile>

link

answered 18 Jun '12, 04:39

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×9
×4
×1

Asked: 15 Jun '12, 13:53

Seen: 5,088 times

Last updated: 18 Jun '12, 04:39