String Splitter (CRT):
The CRT_StringSplitter node is designed to efficiently divide a single string into multiple segments based on specified criteria, making it a versatile tool for text manipulation tasks. This node is particularly useful when you need to process or analyze different parts of a text separately, such as splitting paragraphs or sections of a document. By allowing you to define a custom symbol for splitting or defaulting to empty lines, it provides flexibility in how the text is divided. The node also offers the option to strip whitespace from each segment, ensuring clean and precise outputs. Its primary goal is to simplify the process of breaking down complex strings into manageable parts, enhancing your ability to work with text data in creative and structured ways.
String Splitter (CRT) Input Parameters:
text
This parameter represents the input string that you want to split. It supports multiline text, allowing you to input paragraphs or large blocks of text. The default value is a sample text with two paragraphs, but you can replace it with any text you need to process. The function of this parameter is to provide the raw data that will be divided into segments based on the specified criteria.
split_count
The split_count parameter determines the number of segments you want to extract from the input text. It is an integer value with a default of 2, a minimum of 1, and a maximum of 64. This parameter controls how many parts of the split text will be actively returned, allowing you to manage the granularity of the output.
split_symbol
This parameter allows you to specify a custom character or string to use as the delimiter for splitting the text. If left empty, the node will default to splitting by empty lines. This flexibility enables you to tailor the splitting process to your specific needs, whether you're working with structured data or free-form text.
strip_whitespace
The strip_whitespace parameter is a boolean option that, when enabled, removes leading and trailing whitespace from each split segment. The default setting is True, which helps ensure that the resulting segments are clean and free of unnecessary spaces. This is particularly useful for maintaining the integrity of the text data and ensuring consistent formatting.
String Splitter (CRT) Output Parameters:
string_1, string_2, ..., string_64
These output parameters represent the individual segments of the input text after it has been split according to the specified criteria. Each output corresponds to a part of the text, with the number of active outputs determined by the split_count parameter. If the number of segments is less than the maximum allowed, the remaining outputs will be empty strings. This structured output format allows you to easily access and utilize each part of the text for further processing or analysis.
String Splitter (CRT) Usage Tips:
- Use the
split_symbolparameter to customize how your text is divided, especially when working with structured data that uses specific delimiters. - Enable
strip_whitespaceto ensure that each segment is clean and free of unnecessary spaces, which can be particularly useful when preparing text for further processing or analysis. - Adjust the
split_countto match the number of segments you need, keeping in mind that the node can handle up to 64 outputs, providing flexibility for various text processing tasks.
String Splitter (CRT) Common Errors and Solutions:
Warning: Input text is empty.
- Explanation: This warning occurs when the input text is either empty or consists solely of whitespace.
- Solution: Ensure that the
textparameter contains valid content before attempting to split it. Double-check your input to confirm that it is not empty or filled with only spaces.
Using custom symbol for splitting: '' (empty string)
- Explanation: This message indicates that the
split_symbolparameter is set to an empty string, causing the node to default to splitting by empty lines. - Solution: If you intended to use a specific delimiter, make sure to provide a valid character or string in the
split_symbolparameter. If splitting by empty lines is desired, no action is needed.
