Visit ComfyUI Online for ready-to-use ComfyUI environment
Extract specific lines from text based on index and delimiter, useful for text manipulation and data parsing.
The ExtractLinesByIndex
node is designed to facilitate the extraction of specific lines from a block of text based on a given index and delimiter. This node is particularly useful when you need to isolate and work with specific segments of text, such as extracting a series of lines from a document or a list. By specifying a starting index and a delimiter, the node allows you to retrieve a sequence of up to five lines, starting from the specified index. This functionality is beneficial for tasks that require precise text manipulation, such as data parsing, text analysis, or content formatting, making it an essential tool for AI artists who need to manage and manipulate text data efficiently.
The input_text
parameter is a multiline string that serves as the source text from which lines will be extracted. This parameter is crucial as it provides the content that the node will process. The default value is an empty string, and it supports multiline input, allowing you to work with extensive text blocks.
The delimiter
parameter is a string that determines how the input text is split into lines. By default, it is set to "标签符", but you can specify any character or string to act as the delimiter. If left empty or set to a newline character (\n
), the text will be split by lines. This parameter significantly impacts how the text is divided and, consequently, which lines are extracted.
The index
parameter is an integer that specifies the starting point for line extraction. It determines the first line to be included in the output, with the node extracting up to five consecutive lines starting from this index. The default value is 1, and the minimum value is also 1, ensuring that the extraction starts from the first line or later.
The 文本1
output represents the first line extracted from the specified index in the input text. It is the primary line of interest based on the given index and delimiter.
The 文本2
output provides the second line following the specified index, offering additional context or content from the input text.
The 文本3
output contains the third line extracted, further extending the sequence of lines retrieved from the input text.
The 文本4
output includes the fourth line in the sequence, continuing the extraction process from the input text.
The 文本5
output is the fifth and final line extracted, completing the set of lines retrieved based on the specified index and delimiter.
RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.