EZ Extract Prompt:
The EZ_Extract_Prompt node is designed to efficiently extract specific sections of text from a given string based on user-defined criteria. This node is particularly useful for AI artists who need to parse and utilize structured text data, such as prompts or instructions, from larger documents. By allowing you to specify a search word, the node can identify and extract relevant sections of text that follow a particular header or keyword. Additionally, it offers the flexibility to extract all non-header lines if desired, making it versatile for various text processing tasks. The node also provides an option to return the original text if no relevant content is found, ensuring that you always have access to the complete data set. This functionality is essential for managing and organizing text data, enabling you to focus on the creative aspects of your work without getting bogged down by manual text extraction.
EZ Extract Prompt Input Parameters:
string
The string parameter is the input text from which you want to extract specific sections. It serves as the source data for the extraction process. This parameter is crucial as it contains the entire text content that will be parsed and analyzed by the node. There are no specific minimum or maximum values for this parameter, as it can be any length of text.
searchword
The searchword parameter allows you to specify a keyword or header that the node will use to identify the starting point for text extraction. This parameter is case-insensitive and is essential for targeting specific sections of the text that follow a particular header. By setting this parameter, you can focus the extraction process on relevant content, making it easier to manage and utilize the extracted data.
extract_all
The extract_all parameter is a boolean option that, when set to true, instructs the node to extract all non-header lines from the input text. This parameter is useful when you want to retrieve all content except for headers, providing a comprehensive view of the text data. The default value is typically false, meaning that the node will only extract sections based on the searchword unless specified otherwise.
pass_original
The pass_original parameter is a boolean option that determines whether the original text should be returned if no relevant content is extracted. When set to true, this parameter ensures that you still have access to the complete text data, even if the extraction criteria are not met. This is particularly useful for maintaining data integrity and ensuring that no information is lost during the extraction process.
EZ Extract Prompt Output Parameters:
result
The result parameter is the output of the node, containing the extracted text based on the specified criteria. This output is a string that includes the relevant sections of the input text, as determined by the searchword and extract_all parameters. If no content is extracted and pass_original is true, the output will be the original text. This parameter is crucial for accessing and utilizing the extracted data in subsequent processes or creative tasks.
EZ Extract Prompt Usage Tips:
- Use the
searchwordparameter to target specific sections of your text, ensuring that you extract only the most relevant content for your needs. - Set the
extract_allparameter to true if you want to retrieve all non-header lines, providing a comprehensive view of the text data without manual filtering. - Enable the
pass_originalparameter to ensure that you always have access to the complete text data, even if no relevant content is extracted.
EZ Extract Prompt Common Errors and Solutions:
No content extracted
- Explanation: This error occurs when the node does not find any text matching the specified
searchwordor criteria. - Solution: Ensure that the
searchwordis correctly specified and matches the headers in your text. Consider enabling thepass_originalparameter to return the original text if no content is extracted.
Incorrect searchword
- Explanation: The
searchwordmay not match any headers in the input text, leading to no extraction. - Solution: Double-check the spelling and case of the
searchword. Remember that the search is case-insensitive, so ensure that the keyword is correctly specified.
Empty input string
- Explanation: The input
stringis empty, resulting in no content to extract. - Solution: Provide a valid input text for the node to process. Ensure that the
stringparameter contains the text data you wish to analyze.
