convert-text-to-list

Description

convert-text-to-list adaptor converts text into a list using the specified separator to denote the points at which each split should occur.

The default separator used for each split is the \ (newline) character, this can be changed by setting the separator input. The number of values to be included in the output list can be limited by setting the limit input.

Inputs

text Type: text Required: Yes The text to be converted.

separator Type: text Required: No The separator text, or regular expression, which denotes the points at which each split should occur. The separator is treated as a regular expression if it begins and ends with /. If unspecified, defaults to (newline).

limit Type: number Required: No A positive integer specifying a limit on the number of splits to be found. If unspecified, defaults to null (no limit).

Outputs

list Type: list A list of texts split at each point where the separator occurs in the input text, or an empty list if no occurrences found.

Examples

Example 1: Default behaviour.

Inputs:

text:

Spring
Summer
Autumn
Winter

Outputs:

list:

  • Spring

  • Summer

  • Autumn

  • Winter

-> Converted text to list.

Example 2: Convert text with comma separator.

Inputs:

text:

Spring,Summer,Autumn,Winter

separator: , (comma)

Outputs:

list:

  • Spring

  • Summer

  • Autumn

  • Winter

-> Converted text with comma separator to a list.

Last updated