Replace Text - Data360_Analyze - 3 - 3.12

Data360 Analyze Server Help

Product type
Software
Portfolio
Verify
Product family
Data360
Product
Data360 Analyze
Version
3.12
Language
English
Product name
Data360 Analyze
Title
Data360 Analyze Server Help
Copyright
2023
First publish date
2016

This deprecated node replaces one or more given segments of text with other segments of text.

CAUTION:
This node has been deprecated and will not be supported in a future release. As an alternative, the Transform node can be used to provide similar functionality.

To enable the Replace Text node, configure the Fields and Rules properties by entering Script.

  1. In the Fields property, specify which field(s) of the input data you want to apply the text substitution rule to, in the following format: <FieldName>=<RuleName>

    For example, to apply a rule to a specific input field (in this case text1), specify the field name as follows: text1=rule1

    Alternatively, to indicate that the rule should apply to all fields (columns) of the input data, use '*': *=rule1

  2. In the Rules property, define the text substitution rule(s) to apply to the specified input data. Each rule should be introduced with a header line, followed by the substitution rule, in the following format:

    <RuleName>::<SubstitutionRule>

    A header line is a section name followed by two colons.

    There are three types of substitution that you can use, as follows:

    • Character mapping converts the characters on the left side of the rule to the characters on the right side of the rule, using the following format, where 'a' becomes 'z':a->z
    • Translate mapping converts 'a' to 'd', 'b' to 'e' and 'c' to 'f', using the following format:abc:>def
    • Invocations reference a rule within a rule, using the following format:rule:: <RuleReference>
Note: There must be the same number of characters on both sides of a rule. Rules can be written using either lower or upper case characters. Regardless of the character case specified in the rule, the substitution is applied to all instances and the input character case is maintained in the output; for example, a rule defining a->z results in a becoming z and A becoming Z.

Example

The following example illustrates all three substitution rule types. Take the following input data:

text1 text2 text3
abc1 def1 ghi1
ABC1 DEF1 GHI1
CBA1 FED1 IHG1

In the Fields property, enter the following Data360 Analyze Script which results in rule name rule1 applying to all fields from the input data: *=rule1

In the Rules property, enter the following Data360 Analyze Script:

rule0::1->0rule1::ai:>jz<rule0>

The output is as follows:

text1 text2 text3
jbc0 def0 ghz0
JBC0 DEF0 GHZ0
CBJ0 FED0 ZHG0
Tip: In this example, although only rule1 is specified in the Fields property, both rule1 and rule0 have been acted upon; this is because rule0 is referenced within rule1.

Properties

Fields

Specify which fields from the input data that you want to apply the text substitution rules to along with the name of the rule. For example, for a rule named rule1 that is to apply to all fields, enter *=rule1.

A value is required for this property.

Rules

Define the text substitution rules to apply to the specified input fields.

Each rule should be introduced with a header line, followed by the substitution rule. For example, to substitute 1 with 0, enter: rule1::1->0

A value is required for this property.

Inputs and outputs

Inputs: in1.

Outputs: out1.