使用“动态重命名”工具可重命名上游数据中的列。使用此工具可重命名列标题中的模式,如移除前缀或用空格替换下划线。
提示
此工具具有单个工具示例。查看访问示例工作流以了解如何在 Designer Cloud 中直接访问此示例和其他更多示例。
选择重命名方法:
添加前缀
添加后缀
移除前缀
移除后缀
使用右侧输入元数据中的列名称
Formula
Use First Row's Data as Column Headers
Use Rows from R Input as Column Headers
为所选列的名称添加前缀或后缀。在输入前缀或输入后缀中,为每个所选列标题输入前缀或后缀。新的列名称将更新为带有新前缀或后缀的示例列标题。
删除所选列名称中的前缀或后缀。
在输入要移除的前缀或输入要移除的后缀中,输入要从每个所选列标题中移除的前缀或后缀。
如果未移除前缀,请选择报告行为:
警告(继续数据处理)
错误(停止数据处理)
忽略(继续数据处理)
更新所有列,使新列名称与连接到 R 锚点的第二个输入中的列名称匹配。
如果列数不同,请选择报告行为:
警告(继续数据处理)
错误(停止数据处理)
忽略(继续数据处理)
选中更改列数据类型来更改新列数据类型,以匹配第二个输入列中的数据类型。
Columns are renamed based on a built expression. To build an expression to rename selected fields, either enter text directly in the expression editor or double-click a variable or function from the Properties section to add it to the Expression editor.
Select the column to rename via the checkbox next to the column name or via the Select All checkbox.
Select Dynamic or Unknown Columns so columns not present at configuration are renamed at runtime.
The Current Field is the individual column to which the formula is applied. The formula is applied to each selected column from the list.
Use the values found in the first row as column names for the selected columns.
For example, a dataset contains this data:
Column 1 | Column 2 | Column 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:
Address | City | ZIP |
---|---|---|
3825 Iris Ave | Boulder | 80301 |
Select the report behavior If Number of Columns Differ:
Warn (Continue Data Processing)
Error (Stop Data Processing)
Ignore (Continue Data Processing)
Selected columns are renamed so that the column headers match the values from the input rows of a second input that is connected to the R input anchor. Under Rename Method, select one of:
Use Column Position: Re-assign column names based on their row position in relation to the column position on the left.
Use Lookup Values from the R Input Anchor: Rename columns based on a lookup table connected to the R input anchor. Think of the lookup table as a table that contains one column of your current column names and a second column with the corresponding new column names.
Column with Lookup Values: Select the column in your lookup table that contains the current column names.
Column with Rename Values: Select the column in your lookup table that contains the new column names.
Select the report behavior If Number of Columns Differ:
Warn (Continue Data Processing)
Error (Stop Data Processing)
Ignore (Continue Data Processing)