How to use Text Splitting

Examples of how to use text splitting to match delimited dimension values in your data and extract specific fragments from those values.

John Johansson avatar
Written by John Johansson
Updated over a week ago

Text Splitting is a simple but powerful way to extract fragments of your data when Working with dimension rule results. It is suitable for ‘delimited’ text data, such as comma-delimited values (CSV), URLs, and other data where several text fragments are separated by a character or string (delimiter) [see below].

Text Splitting is similar to using [regular expressions] but does not require any advanced knowledge about text matching.

Extracting / Capturing parts of a value

Start by selecting which dimension you need to extract data from, then 'split by' and enter which delimiter you want to use. Make sure you select the correct fragment as the result. Starting or ending whitespace characters will be removed always.

The first fragment, located before the first delimiter, is called 'fragment 1' and so on...

Data is only considered a match when it contains one or more matching delimiters.

What is a delimiter?

A delimiter is one or more characters that separate text strings. Common delimiters are commas ( , ), semicolon ( ; ), pipes ( | ), underscores ( _ ) or slashes ( / ).

When do I use 'split by' and when do I use 'regex'

The rule of thumb is to use 'split by' when text is neatly divided into readable pieces ('fragments') by a distinctive delimiter (see Examples).
When data uses different delimiters or is otherwise non-uniform, regex (regular expressions) is likely a better solution (see How to use regex matches).

Examples

Date ("2021-01-01") from "2021-01-01T12:00:00":

  • 'split by' - "T"

  • use 'split result' - 'fragment 1'

"Country" from "CampaignType | Product | Country":

  • 'split by' - "|"

  • use 'split result' - 'fragment 3'

Did this answer your question?