Captures a value from an existing field using regex and inserts the matching groups in newly created field(s). The original field is omitted, and if there is no match to the given regex format, an error is thrown.
Example
Example Input
dim_A | dim_B | metric_1 |
AAA_aaa | DDD | 111 |
BBB_111 | EEE | 222 |
CCC_ccc | FFF | 333 |
Example Output
dim_B | metric_1 | field1 | field2 |
DDD | 111 | AAA | aaa |
EEE | 222 | BBB | 111 |
FFF | 333 | CCC | ccc |
I Ain't Afraid of No Code!
[
"namingconvention",
{
"subtable": null,
"newfields": [
"field1",
"field2"
],
"field": "dim_A",
"pattern": "(.*)_(.*)",
"_comment": null
}
]
param str subtable: Name a subtable in which output will be stored (will create subtable where necessary).
param list newfields: Newly created fields in which contents of matching groups are parsed. Requires one result field per matching group.
param str field: Field(s) on which Regex will be performed.
param str pattern: Regex with n capturing groups to match field.
param str comment: A comment that will appear in the Transformation UI.
Comments
0 comments
Article is closed for comments.