StringReplacement

The element defines the conversion of input data by replacing substrings.

<StringReplacement
    pattern="string"
    replacement="string"
    >
</StringReplacement>

Contained-In:

<Transformations>

Attributes:

pattern

The substring to be replaced.

replacement

The string to be placed in place of the pattern.

Example using grouping in the regular expressions:

As an example for pipe-delimited data in the following format: 1234,Charlie Brown|Somewhere Canada|999-999-9999,1000

The name Charlie Brown and the Phone 999-999-9999 can be extracted with the following config:

  <Schema>
            <Column name="Name" dataType="Text">
                <Transformations>
                    <StringReplacement pattern="(.*),(.*)" replacement="$2" />
                </Transformations>
            </Column>
            <Column name="Address" dataType="Text" />
            <Column name="Phone" dataType="Text">
                <Transformations>
                    <StringReplacement pattern="(.*),(.*)" replacement="$1" />
                </Transformations>
            </Column>
        </Schema>

Last updated