SPLIT

Available as of Datameer v6.3

Syntax

SPLIT(<string>; <string separator>; <index>])

Description

Splits text specified by a string separator(s). An additional index value (with the index of 0 returning the first argument) can be assigned to return a specific split argument. 

If you want to split or separate text using regular expression, use the TOKENIZE function.

Examples

Example 1:

Use the SPLIT function to separate a string column. Results are shown in a new column with all separated arguments in individual rows. 

TextSeparator
home/user/path1/path2/path3/file_name.csv/

Results

TextSPLIT_Result
home/user/path1/path2/path3/file_name.csvhome
home/user/path1/path2/path3/file_name.csvuser
home/user/path1/path2/path3/file_name.csvpath1
home/user/path1/path2/path3/file_name.csvpath2
home/user/path1/path2/path3/file_name.csvpath3
home/user/path1/path2/path3/file_name.csvfile_name.csv


Example 2:

Assign an index value to specify which arguments are returned.

TextSeparatorIndex
home/user/path1/path2/path3/file_name.csv/5

Results

Text SPLIT_Result
home/user/path1/path2/path3/file_name.csvfile_name.csv


Example 3:

If the string starts or ends with a separator, or has two consecutive separators, the SPLIT function produces empty results.

TextSeparator
,,x,,

Results

TextSPLIT_Result
,,x,
,,x,
,,x,x
,,x,


Example 4:

A limitation with the SPLIT function is that it is not possible to enter whitespaces within the formula builder as a string separator. It is still possible to enter whitespaces manually on the fx line in the workbook.

Example:

Text
Thomas Jackson
Emma Smith

fx = SPLIT(#Text;" ";1)

Result

TextSPLIT_Result
Thomas JacksonJackson
Emma SmithSmith