ComfyUI > Nodes > ComfyUI_StringOps > 按序号提取分割文本(meeeyo.com)

ComfyUI Node: 按序号提取分割文本(meeeyo.com)

Class Name

SplitAndExtractText

Category
Meeeyo/String
Author
MeeeyoAI (Account age: 14days)
Extension
ComfyUI_StringOps
Latest Updated
2025-03-07
Github Stars
0.02K

How to Install ComfyUI_StringOps

Install this extension via the ComfyUI Manager by searching for ComfyUI_StringOps
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI_StringOps in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

按序号提取分割文本(meeeyo.com) Description

Facilitates text segment extraction by splitting based on delimiter and selecting by index for structured data processing.

按序号提取分割文本(meeeyo.com):

The SplitAndExtractText node is designed to facilitate the extraction of specific segments from a block of text by splitting it based on a specified delimiter and then selecting a particular segment by its index. This node is particularly useful for processing structured text data where you need to isolate and work with specific parts of the text. By allowing you to choose the order of extraction and whether to include the delimiter in the output, this node provides flexibility in handling text data. Its primary goal is to streamline the process of text manipulation, making it easier to extract meaningful information from larger text bodies without requiring extensive manual editing.

按序号提取分割文本(meeeyo.com) Input Parameters:

input_text

This parameter represents the text that you want to process. It can be a multiline string, allowing you to work with paragraphs or lists. The input text is the source from which segments will be extracted based on the specified delimiter and index.

delimiter

The delimiter is a string that defines how the input text should be split into segments. By default, it is set to "分隔符", but you can specify any string that suits your text structure. The choice of delimiter directly impacts how the text is divided and, consequently, which segments are available for extraction.

index

The index parameter determines which segment of the split text will be extracted. It is an integer value starting from 1, with a default value of 1. This parameter allows you to specify the exact segment you want to retrieve, making it crucial for targeted text extraction.

order

This parameter allows you to choose the order in which the segments are considered for extraction. It offers two options: "顺序" (sequential order) and "倒序" (reverse order), with the default being "顺序". This flexibility enables you to extract segments from the beginning or end of the text, depending on your needs.

include_delimiter

A boolean parameter that specifies whether the delimiter should be included in the extracted segment. By default, it is set to False. Including the delimiter can be useful if the delimiter itself carries meaningful information or if you need to maintain the original text structure in the output.

按序号提取分割文本(meeeyo.com) Output Parameters:

STRING

The output is a single string that represents the extracted segment from the input text. This string is the result of splitting the input text by the specified delimiter and selecting the segment at the given index. The output will reflect the order and inclusion of the delimiter as specified by the input parameters.

按序号提取分割文本(meeeyo.com) Usage Tips:

  • To effectively use this node, ensure that the delimiter you choose accurately reflects the structure of your input text. This will help in correctly segmenting the text for extraction.
  • If you need to extract segments from the end of the text, consider using the "倒序" option for the order parameter to simplify the process.

按序号提取分割文本(meeeyo.com) Common Errors and Solutions:

ValueError

  • Explanation: This error may occur if the input parameters are not correctly formatted or if the index is out of range.
  • Solution: Double-check that the index is within the range of available segments after splitting the text. Ensure that the delimiter is correctly specified and that the input text is not empty.

按序号提取分割文本(meeeyo.com) Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI_StringOps
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

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.