Rename by Replacing
Synopsis
This operator can be used to rename a set of attributes by replacing parts of the attribute names by a specified replacement.
Description
The Rename by Replacing operator replaces parts of the attribute names by the specified replacement. This operator is used mostly for removing unwanted parts of attribute names like whitespaces, parentheses, or other unwanted characters. The replace what parameter defines that part of the attribute name that should be replaced. It can be defined as a regular expression which is a very powerful tool but needs a detailed explanation to beginners. It is always good to specify the regular expression through the edit and preview regular expression menu. The replace by parameter can be defined as an arbitrary string. Empty strings are also allowed. Capturing groups of the regular expression of the replace what parameter can be accessed with $1, $2, $3 etc. Please study the attached Example Process for more understanding.
Please keep in mind that attribute names must be unique. The Rename by Replacing operator has no impact on the type or role of an attribute. For example if you have an attribute named 'alpha' of integer type and regular role. Renaming the attribute to 'beta' will just change its name. It will retain its type integer and role regular. To change the role of an operator, use the <reference key="operator.set_role">Set Role</reference>
operator. Many type conversion operators are available for changing the type of an attribute at 'Data Transformation/Type Conversion'.
Input
example set input
This input port expects an ExampleSet. It is the output of the Retrieve operator in the attached Example Process. The output of other operators can also be used as input. It is essential that meta data should be attached with the data for the input because attributes are specified in their meta data.