Node Details

  • Name: csvFile
  • Type: Document
  • Version: 2.0
  • Category: Document Loaders

Input Parameters

  1. Csv File (required)

    • Type: file
    • File Type: .csv
    • Description: The CSV file to be processed
  2. Text Splitter (optional)

    • Type: TextSplitter
    • Description: A text splitter to break down large documents
  3. Single Column Extraction (optional)

    • Type: string
    • Description: Name of a specific column to extract from the CSV
    • Placeholder: Enter column name
  4. Additional Metadata (optional)

    • Type: json
    • Description: Additional metadata to be added to the extracted documents
  5. Omit Metadata Keys (optional)

    • Type: string
    • Description: List of metadata keys to omit from the output, separated by commas
    • Special value: Use ”*” to omit all metadata keys except those specified in Additional Metadata

Outputs

  1. Document

    • Description: Array of document objects containing metadata and pageContent
    • Base Classes: Document, json
  2. Text

    • Description: Concatenated string from pageContent of documents
    • Base Classes: string, json

Functionality

  1. File Loading:

    • Supports loading CSV files from base64-encoded strings or file storage
    • Can process single files or multiple files (when provided as a JSON array)
  2. Data Extraction:

    • Extracts data from CSV files using the CSVLoader from langchain
    • Optionally focuses on a single column if specified
  3. Text Splitting:

    • If a text splitter is provided, it splits the loaded documents
  4. Metadata Handling:

    • Adds custom metadata to documents if provided
    • Can selectively omit default metadata fields
  5. Output Formatting:

    • Can output as an array of document objects or as concatenated text

Use Cases

  • Loading and processing CSV data for natural language processing tasks
  • Extracting specific columns from CSV files for analysis
  • Preparing CSV data for use in language models or other AI applications
  • Combining CSV data with custom metadata for enriched document processing

Notes

  • The node handles escape characters in the output text
  • It’s designed to work within a larger system, likely a workflow or pipeline for document processing