EZ CSV Loader:
The EZ_CSV_Loader node is designed to facilitate the loading and processing of data from CSV files within a user-friendly interface. Its primary function is to allow you to select and load specific rows from a CSV file based on your input criteria, such as filtering text or choosing a selection mode. This node is particularly beneficial for managing large datasets, as it provides a streamlined method to access and manipulate data without requiring extensive technical knowledge. By leveraging the first column of the CSV as labels, it simplifies the process of identifying and selecting data, making it an essential tool for AI artists who need to work with structured data efficiently.
EZ CSV Loader Input Parameters:
csv_file
This parameter specifies the CSV file you wish to load and search through. It is essential for determining the source of the data you want to process. The node will search for CSV files within a predefined directory, and you can select the desired file from a list. This parameter does not have a default value, as it requires explicit selection by the user.
selection_mode
The selection_mode parameter determines how rows are selected from the CSV file. It offers three options: "single," "multiple," and "random." The "single" mode allows you to select one item at a time, "multiple" mode enables the selection of several items with the output being comma-separated, and "random" mode randomly selects one of the visible items, using a seed if provided. The default mode is "single," and this parameter significantly impacts how data is retrieved and presented.
opt_seed
This optional parameter is an integer used to control the randomness in the "random" selection mode. It ranges from 0 to 0xffffffffffffffff and is only applicable when the "random" mode is active. If not connected, the node will re-execute on each prompt, ensuring varied outputs. The default value is 0, and it is crucial for ensuring consistent random selections when needed.
filter_text
The filter_text parameter allows you to filter the rows based on a specific text string. It searches for the provided text in any cell of the CSV, making it easier to narrow down the data to relevant entries. The default value is an empty string, meaning no filtering is applied unless specified. This parameter is useful for quickly locating specific data within large datasets.
selected_row
This parameter allows you to specify a particular row to be selected from the CSV file. It is a string that corresponds to the label of the row you wish to select. The default value is an empty string, indicating no specific row is pre-selected. This parameter is particularly useful when you need to focus on a specific entry within the dataset.
EZ CSV Loader Output Parameters:
STRING
This output provides the content of the selected row(s) from the CSV file. It is typically used in conjunction with a prompt extractor to process the data further. This output is crucial for accessing the actual data content you are interested in.
OPT_FILEPATH
The OPT_FILEPATH output returns the path to the currently selected CSV file. This information is useful for verifying the source of the data and ensuring that the correct file is being processed.
BATCH_SELECTED
This output is a list of all selected items, which will include all visible (filtered) items if none or a single item is selected. It is particularly useful for batch processing or when multiple selections are needed, providing a comprehensive view of the selected data.
EZ CSV Loader Usage Tips:
- Use the
filter_textparameter to quickly locate specific data entries within large CSV files, saving time and effort in data processing. - When working with random selections, connect the
opt_seedparameter to ensure consistent results across different executions, especially when reproducibility is important. - Familiarize yourself with the selection modes to optimize data retrieval based on your specific needs, whether you require single, multiple, or random selections.
EZ CSV Loader Common Errors and Solutions:
"No CSV file found"
- Explanation: This error occurs when the specified CSV file cannot be located in the directory.
- Solution: Ensure that the CSV file is present in the correct directory and that the file path is correctly specified.
"No data rows found in file"
- Explanation: This error indicates that the CSV file does not contain any data rows beyond the header.
- Solution: Verify that the CSV file is not empty and contains the expected data rows.
"No matching rows found"
- Explanation: This error arises when no rows match the specified
filter_text. - Solution: Check the filter criteria and ensure that it accurately reflects the data you are searching for. Adjust the filter text as needed to match the desired entries.
