Node Inputs

  • text

    • Data Type: text
    • Description: Text to be split into a list of text.
    • Attribute Type: Can be used as both input and output.
  • split characters

    • Data Type: text
    • Description: Characters that the original text should be split on. If not specified, the default character is a comma (,).
    • Attribute Type: Parameter (used to specify how the node behaves).
    • Optional: Yes
  • newline split

    • Data Type: boolean
    • Description: Indicates whether to split the text on a newline (\n) character. If selected, split characters will be ignored.
    • Attribute Type: Parameter (used to specify how the node behaves).
    • Optional: Yes

Node Output

  • List of text
    • Data Type: List of text
    • Description: List of text where each element represents a portion of the original text that was split.

Node Functionality

The Split Text node provides the functionality to take a single text and divide it into multiple parts based on specified characters or a newline. This node can handle a list of operations, meaning that it can split a list of text in one go if needed. For example, a user can input a paragraph and choose to split it every time a comma or period is encountered. This would result in a list of sentences.

Equipped with two optional parameters, the node can either split the text using a set of characters provided by the user (such as a comma, semicolon, space, etc.) or use the newline character to divide the text into lines. If the newline option is selected, any other specified characters to split by will be disregarded.

If the user does not provide any split characters, the node defaults to using a comma as the splitting criterion. Additionally, if the input text is empty or does not contain the splitting character(s), the output will be an empty list, indicating that no splitting occurred.

When To Use

You should use the Split Text node when you need to organize or analyze parts of a text independently. It is especially useful in data processing tasks such as:

  • Dividing a long piece of text into sentences or words for further analysis or manipulation.
  • Separating values from a comma-separated list to process each item individually.
  • Extracting specific elements from standardized blocks of text like logs, configuration files, or structured data.

You can think of this node as a precise paper shredder that cuts a single sheet of printed text into neat, readable strips based on the cuts you define.