πŸ”¬ Clean & standardize CSV uploads for Google Sheets and Drive import

⚑ 662 views Β· πŸ”¬ Document Extraction & Analysis

Description

🧹 Auto-Clean CSV Uploads Before Import

This workflow automatically cleans, validates, and standardizes any CSV file you upload. Perfect for preparing customer lists, sales leads, product catalogs, or any messy datasets before pushing them into Google Sheets, Google Drive, or other systems.


βš™οΈ How It Works

  1. CSV Upload (Webhook)

    • Upload your CSV via webhook (supports form-data, base64, or binary file upload).
    • Handles files up to ~10MB comfortably.
  2. Extract & Parse

    • Reads raw CSV content.
    • Validates file structure and headers.
    • Detects and normalizes column names (e.g. First Name β†’ first_name).
  3. Clean & Standardize Data

    • Removes duplicate rows (based on email or all fields).
    • Deletes empty rows.
    • Standardizes fields:
      • Emails β†’ lowercased, validated format.
      • Phone numbers β†’ normalized (xxx) xxx-xxxx or +1 format.
      • Names β†’ capitalized (John Smith).
      • Text β†’ trims spaces & fixes inconsistent spacing.
    • Assigns each row a data quality score so you know how β€œclean” it is.
  4. Generate Cleaned CSV

    • Produces a cleaned CSV file with the same headers.
    • Saves to Google Drive (optional).
    • Ready for immediate import into Sheets or any app.
  5. Google Sheets Integration (Optional)

    • Clears out an existing sheet.
    • Re-imports the cleaned rows.
    • Perfect for always keeping your β€œmaster sheet” clean.
  6. Final Report

    • Logs processing summary:
      • Rows before & after cleaning.
      • Duplicates removed.
      • Low-quality rows removed.
      • Average data quality score.
    • Outputs a neat summary for auditing.

πŸ› οΈ Setup Steps

  1. Upload Method

    • Use the webhook endpoint generated by the CSV Upload Webhook node.
    • Send CSV via binary upload, base64 encoding, or JSON payload with csv_content.
  2. Google Drive (Optional)

    • Connect your Drive OAuth credentials.
    • Replace YOUR_DRIVE_FOLDER_ID with your target folder.
  3. Google Sheets (Optional)

    • Connect Google Sheets OAuth.
    • Replace YOUR_GOOGLE_SHEET_ID with your target sheet ID.
  4. Customize Cleaning Rules

    • Adjust the Clean & Standardize Data code node if you want different cleaning thresholds (default = 30% minimum data quality).

πŸ“Š Example Cleaning Report

Input file: raw_leads.csv

βœ… Clean CSV saved to Drive
βœ… Clean data imported into Google Sheets
βœ… Full processing report generated


🎯 Why Use This?


⚑ Upload dirty CSV β†’ Get clean, validated, standardized data instantly!

πŸ”— Nodes Used

Google Sheets, Webhook, Google Drive

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup