Skip to main content

Text

Split a string to multiple columns or a list.

Split text strings on certain characters. The text can be split into either multiple columns or a list.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the column to be split.string—Yes
outputName of the output column(s) If a single column is provided, the results will be returned as a list If multiple columns are listed, the results will be separated into the columns. If omitted, will overwrite the input.string, array, nullnullNo
Options
charSet the character(s) to split on. Default comma (,) Can also prefix with "regex:" to split on a pattern.string","No
elementSelect a specific element or range after splitting using slicing syntax. e.g. 0, ":5", "5:", "2:8:2".string, integer, nullnullNo
inclusiveIf true, include the split character in the output. Default False.booleanfalseNo
skip_emptyWhether to skip empty values.booleanfalseNo
Formatting
padChoose whether to pad to ensure a consistent length. Default true if outputting to columns, false for lists.boolean, nullnullNo
Conditions
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No
whereFilter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'.string—No
where_paramsValues used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name.array, object—No

Examples​

wrangles:
- split.text:
input: Column1
output: Column2
char: ', '
Column1
Hello, Wrangles!
Column2
['Hello', 'Wrangles!']
# Split on x, case insensitive.
wrangles:
- split.text:
input: Col1
output: Col2
char: 'regex:(?i)x'
Col1
1x2
1X2
Col2
['1', '2']
['1', '2']
wrangles:
- split.text:
input: Column1
output: Column2
char: ', '
element: 0
Column1
Hello, Wrangles!
Column2
Hello
wrangles:
- split.text:
input: Col
output: Col* # Optional
char: ', '
Col
Hello, Wrangles!
Col1Col2
HelloWrangles!
wrangles:
- split.text:
input: Col
output:
- Col 1
- Col 2
- Col 3
char: ', '
Col
Wrangles, are, Cool!
Col 1Col 2Col 3
WranglesareCool!
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID65
Catalog keysplit.text
Recipe keysplit.text
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespacesplit
Documentation groupsplit
AliasesNone
Runtime symbolwrangles.recipe_wrangles.split.text
Legacy UUIDe76e43f7-d129-4bf8-87b4-a304a378b130

Sources