Dynamic Rename Tool
The Dynamic Rename tool renames columns within an input data stream. Use this tool to parse text files, to pull column names from the first row of data or a description file, or to rename a pattern in the column names, such as removing a prefix or suffix, or replacing underscores with spaces.
Configure the tool
Select a Rename Mode:.
Columns are renamed based on a built expression. To build an expression to rename selected fields, either type directly in the expression editor or double-click a variable or function to add it to the Expression Editor.
Select the fields to be renamed by selecting the check box next to the field name or by clicking the All button.
- Select Dynamic /Unknown fields so columns not present at configuration are renamed at runtime.
- Current Field is the individual field the formula is applied to. Each field selected from the list of fields will have the formula applied to it.
Selected columns are renamed to include a prefix or suffix.
- Under Properties, type a prefix or suffix to Add to each selected column name.
- Select either Prefix or Suffix.
Selected columns are renamed to exclude a prefix or suffix.
- Under Properties, type a prefix or suffix to Remove from each selected column name.
- Select either Prefix or Suffix.
If any of the selected columns are not renamed, select the report behavior: Warn, Error, or Ignore.
Selected columns are renamed by turn the column name into the value found in the first row.
Field rename example
For example, a dataset contains the following data.
Field 1 | Field 2 | Field 3 |
Address | City | ZIP |
3825 Iris Ave | Boulder | 80301 |
If the columns are renamed with the field names from the first row of data, the dataset changes to be as follows.
Address | City | ZIP |
3825 Iris Ave | Boulder | 80301 |
Under Properties, select the report behavior for if fields are missing: Warn, Error, or Ignore.
Selected columns are renamed using the field names from a second input, connected to the R anchor. Only the field names from the second input are brought in; the data does not come through.
- If the number of field names do not match, select the report behavior: Warn, Error, or Ignore.
- Select Change field type and size to match the data type and size of the incoming fields as well as the name.
Selected columns are renamed by taking row data from a second input file and applying the data based on row position or field map assignment.
Under Properties, select the report behavior for if the number of field names do not match: Warn, Error, or Ignore.
Old Field Name from Column: Select from the list of R input field names, which includes the old field names. Use Positional Rename re-assigns field names based on their row position in relation to the field position on the left.
New Field Name from Column: Select from the list of R input fields, which includes the new replacement field names.
Selected columns are updated so the descriptions match the field descriptions from a second input that is connected to the R anchor. Descriptions are updated based on the positions within each input.
Under Properties, select the report behavior for if the number of field names do not match: Warn, Error, or Ignore.
Selected columns are updated so the descriptions match the descriptions from the input rows of a second input that is connected to the R anchor.
Under Properties, select the report behavior for if the number of field names do not match: Warn, Error, or Ignore.
Field Name from Column: Select from the list of R input field names. Use Positional Rename re-assigns field names based on their row position in relation to the field position on the left.
New Description Name from Column: Select from the list of R input fields, which includes the new replacement description values.
Troubleshoot
When using a right input for field names, be aware of the record order. A join or similar tool can change the order of records, which could result in incorrect field name assignment.