OpenBI Docs Buy

Splitter.SplitTextByAnyDelimiter

Makes a function that cuts text wherever any of several separators occurs.

Group: Splitters, combiners, replacers and comparers. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

Splitter.SplitTextByAnyDelimiter(delimiters as list, optional quoteStyle as nullable number, optional startAtEnd as nullable logical) as function
ParameterTypeDescription
delimiterslistThe separators, each a text; any of them splits.
quoteStylenullable number
optional
QuoteStyle.Csv (the default): a delimiter inside double quotes does not split, and the quotes are taken off; QuoteStyle.None: quotes are ordinary characters.
startAtEndnullable logical
optional
true to work from the end of the text toward its start.

Returns

function. A splitter: given a text, the list of the pieces between the separators.

Remarks

  • A splitter is a function of one text that gives a list of texts. Table.SplitColumn and Table.FromList take one; you can also call it yourself, as the examples do.
  • Use it for data typed with mixed separators, such as commas and semicolons.
  • A separator may be longer than one character. Where two of them start at the same place, the one listed first is used: list ", " before "," to take a comma and its space together.
  • Quotes count by default: a separator between double quotes is part of the piece. Pass QuoteStyle.None when quotes are just characters in the data.

Examples

Commas and semicolons

Splitter.SplitTextByAnyDelimiter({",", ";"})("Oslo,Bergen;Trondheim")
{"Oslo", "Bergen", "Trondheim"}

A year, a month and a shop

Splitter.SplitTextByAnyDelimiter({" ", "-"})("2026-03 Oslo")
{"2026", "03", "Oslo"}

A comma with or without a space

Splitter.SplitTextByAnyDelimiter({", ", ","})("Oslo, Bergen,Trondheim")
{"Oslo", "Bergen", "Trondheim"}

Splitter.SplitTextByDelimiter, Splitter.SplitTextByEachDelimiter, Text.SplitAny, Table.SplitColumn.

Last updated · OpenBI Studio 0.3.79