CSV Data Cleaning and Normalization — AI Skill (2026) | Skills and Servers
Data Analysis

CSV Data Cleaning and Normalization

Feed a messy CSV, get back a clean one plus a report of every transformation applied. Handles the usual pain — inconsistent date formats, mixed encodings, combined fields ("Last, First"), leading/trailing whitespace, duplicate rows, and inconsistent categorical values ("USA" / "US" / "United States"). Idempotent — running twice produces the same result as running once.

✓ Anthropic Claude✓ OpenAI✓ Mistral✓ DeepSeek⚠ Google Gemini
Tested 2026-08-11

1Quick Overview

TL;DR — Feed messy CSV, get back clean CSV + a transformation report. Handles date normalization, encoding fixes, combined field splitting, dedupe, categorical standardization. Idempotent — safe to re-run.
text
You: [uploads customers.csv, 12,000 rows, mixed date formats,
      inconsistent country names] "Clean this for our CRM import"

Skill returns:
  ✓ Normalized 4 date columns to ISO 8601 (found 6 formats)
  ✓ Standardized 'Country' column (14 variants → 3 canonical)
  ✓ Split 'Full Name' into first/last (11,847 rows)
  ✓ Removed 43 duplicate rows (based on email)
  ✓ Fixed 128 encoding artifacts (UTF-8 replacement chars)
  ✓ Trimmed whitespace from all string columns

Output: customers-clean.csv + transformations.md

2What This Skill Does

This Skill takes a messy CSV (or Excel sheet exported as CSV) and produces a cleaned version plus a transformation report documenting every change. It handles the common data hygiene problems: inconsistent date formats normalized to ISO 8601, character encoding fixes, combined fields split ("Last, First" → separate columns), leading/trailing whitespace trimmed, duplicate rows detected and removed based on user-specified keys, and inconsistent categorical values collapsed to canonical forms ("USA"/"US"/"United States" → "US").

The transformation report is the important part — it's a plain-English record of every change with row counts and examples. This makes the cleaning reproducible and auditable, which matters when the data feeds downstream systems (CRM import, financial reconciliation, analytics warehouse).

The Skill is idempotent by design — running it twice on the same file produces the same output as running it once. It also refuses to guess when confidence is low: ambiguous dates (03/04/2026 = March 4 or April 3?) trigger a clarifying question rather than a silent guess.

3When You Should Use This Skill

  • The user has a CSV or spreadsheet with obvious data hygiene issues (mixed date formats, encoding artifacts, inconsistent values).
  • The user is prepping data for import into a downstream system that has strict schema requirements.
  • The user needs an auditable data cleaning process — the transformation report is the deliverable.
  • The user is deduplicating a customer list, contact list, or lead list before running a campaign.
  • The user is combining data from multiple sources and needs the categorical values reconciled.

4The Skill Definition (SKILL.md)

The complete SKILL.md file that ships with the download. This is what the model reads when your prompt matches this Skill's trigger conditions.

markdown
---
name: csv-data-cleaning-and-normalization
description: Clean CSV files — normalize dates, fix encodings, split combined fields, dedupe, standardize categorical values. Idempotent. Produces auditable transformation report.
version: 1.9.0
tags: [csv, data-cleaning, normalization, dedupe, etl]
inputs:
  - name: file
    type: file
    required: true
    description: The CSV or Excel file to clean
  - name: dedupe_keys
    type: array
    required: false
    description: Column names to use for duplicate detection (e.g. ["email"])
  - name: date_columns
    type: array
    required: false
    description: Columns known to contain dates (auto-detected if omitted)
  - name: categorical_map
    type: object
    required: false
    description: Manual mapping for categorical standardization
outputs:
  - name: cleaned_file
    type: file
  - name: transformation_report
    type: file
---

## Behavior

1. Load the file. Detect delimiter, encoding, header row.
2. Profile columns: detect dates, numbers, strings, categoricals.
3. For each detected issue, apply the appropriate transformation:
   - Whitespace: trim leading/trailing on all string columns.
   - Encoding: replace common artifacts (é, ’, Â) with proper UTF-8.
   - Dates: normalize to ISO 8601 (YYYY-MM-DD). Ask if ambiguous.
   - Combined name fields: split "Last, First" or "First Last" if consistent pattern.
   - Categoricals: standardize using categorical_map, or auto-cluster if not provided.
   - Duplicates: remove based on dedupe_keys, keeping first occurrence.
4. Emit cleaned file + transformation report.

## Idempotency

Every transformation must be safe to re-apply. Second run on the output of the first run must produce the same output.

## Hard rules

- NEVER silently guess ambiguous dates. Ask.
- NEVER delete data without documenting it in the transformation report.
- NEVER change numeric precision (don't round unless asked).
- If a column's values don't match its inferred type consistently (some numbers, some strings), flag it — don't silently coerce.
- Encoding fixes: only replace known artifacts, never guess.

## Report format

The transformation report is a markdown file with one section per transformation:
- Name of the transformation
- Column(s) affected
- Row count affected
- 3 example before/after pairs
- Any rows requiring manual review (with row numbers)

5How to Install

  1. Download the Skill folder from the sidebar (or clone from GitHub).
  2. Move the folder into your Claude Skills directory:
    bash
    # macOS\n~/Library/Application Support/Claude/skills/csv-data-cleaning-and-normalization/\n\n# Windows\n%APPDATA%\\Claude\\skills\\csv-data-cleaning-and-normalization\\
  3. Quit and re-open Claude Desktop. Confirm the Skill loaded via Settings → Skills.
  1. Download or clone the Skill folder into your project.
  2. Place it under the project Skills directory:
    bash
    .claude/skills/csv-data-cleaning-and-normalization/
  3. Claude Code discovers the Skill on next invocation. No restart needed.
  1. Cursor uses the same Skills format as Claude Desktop.
  2. Place the Skill folder here:
    bash
    # macOS\n~/Library/Application Support/Cursor/skills/csv-data-cleaning-and-normalization/\n\n# Windows\n%APPDATA%\\Cursor\\skills\\csv-data-cleaning-and-normalization\\
  3. Reload Cursor (⌘⇧P → Reload Window). Verify via the Skills panel.
  1. Cline reads Skills from a workspace-relative folder.
  2. In your project root:
    bash
    .cline/skills/csv-data-cleaning-and-normalization/
  3. The Skill is picked up on the next Cline session in this workspace.

6How to Use — Real Examples

Example 1

Basic cleanup — messy customer list

12,000-row customer CSV with typical CRM-export mess.

text
Input: customers.csv (12,043 rows, 8 columns)

Skill profiles the data:
  - 'Signup Date': dates in 6 different formats
  - 'Country': 14 unique values that should be 3 (US, UK, CA)
  - 'Full Name': single column, "Last, First" for 11,847 rows
  - 'Email': 43 duplicates based on lowercased email
  - Various columns: leading/trailing whitespace on 8,921 cells
  - 'Notes': UTF-8 replacement chars in 128 cells

Skill transformations applied (all logged):
  1. Trimmed whitespace: 8,921 cells across 6 columns
  2. Fixed UTF-8 artifacts in 'Notes' column: 128 replacements
  3. Split 'Full Name' → 'First Name' + 'Last Name': 11,847
     rows (196 skipped — single-word names, kept as-is with
     row numbers listed for review)
  4. Normalized 'Signup Date' → ISO 8601: 11,943 rows.
     Flagged: 100 rows had "03/04/2024" format (ambiguous) —
     see report for row numbers requiring manual disambiguation.
  5. Standardized 'Country' (14 → 3): US, UK, CA
  6. Removed duplicates by 'email' (lowercased): 43 rows dropped

Output: customers-clean.csv (12,000 rows) + report.md
Example 2

Idempotent re-run

Running twice produces the same output — safe to re-run in pipelines.

text
First run:
  Input:  customers.csv       (12,043 rows, messy)
  Output: customers-clean.csv (12,000 rows, clean)
  Report: 6 transformations applied

Second run:
  Input:  customers-clean.csv (12,000 rows, already clean)
  Output: customers-clean.csv (12,000 rows, unchanged)
  Report: 0 transformations applied

Every transformation is designed to be a no-op when its
target state is already achieved. Safe to run inside ETL
pipelines that may re-process files.
Example 3

Ambiguous dates — Skill asks rather than guesses

Dates like 03/04/2024 could be March 4 or April 3. Skill asks.

text
Input: sales-log.csv with 'Date' column values like:
  "03/04/2024"
  "12/07/2024"
  "01/15/2024"

Skill analyzes:
  - Some values have day > 12 (e.g. 15) → US format
    (M/D/Y) confirmed for those rows
  - Some values have both parts ≤ 12 → ambiguous

Skill asks:
  "The 'Date' column has 47 rows where the format is
   ambiguous — either M/D/Y (US) or D/M/Y (rest of
   world). Rows with day > 12 confirm M/D/Y. Should
   I apply M/D/Y to all rows?
   
   [Yes, use M/D/Y] [No, use D/M/Y] [Show me the
   ambiguous rows]"

Without user confirmation, Skill will NOT process the
date column. Transformation report will list the column
as "skipped — awaiting user input on format".

7Real-World Use Cases

CRM import prep

Salesforce, HubSpot, or Pipedrive imports fail on messy dates and duplicate emails. Run this Skill first, import success rate goes from 60% to 99%.

Analytics warehouse loading

Data engineering team gets a monthly file from a business unit — needs categorical values reconciled with the warehouse before loading.

M&A due diligence data prep

Target company hands over customer/vendor lists in inconsistent formats. Clean, dedupe, standardize before analysis.

Email list dedupe

Marketing team merging two lists before a campaign — need dedupe based on email, plus consistent country/timezone values for segmentation.

8Common Variations (Fork Ideas)

  • Excel-native fork — Read/write .xlsx directly instead of CSV. Preserves multiple sheets, formulas, and cell formatting. Slower but preserves what CSV loses.
  • PII redaction fork — In addition to cleaning, redact or hash PII (email, phone, address) for teams needing GDPR-safe data before sharing internally.
  • Fuzzy dedupe fork — Standard dedupe is exact-match. Fuzzy fork uses edit distance + phonetic matching to catch "John Smith" vs "J. Smith" vs "Jon Smyth".
  • Schema-validation-first fork — Given a target schema (JSON Schema or Pydantic model), validate the CSV against it and clean specifically to make it conform.
  • Large-file fork — For files over 100MB — chunked processing that never loads the full file into context. Slower but handles multi-GB CSVs.

9Compatible Providers

Provider-by-provider status as of 2026-08-11. See our providers directory for full context on each.

ProviderSupportNotes
Anthropic Claude (Sonnet 5)✓ SupportedRecommended default. Good balance for medium files (up to ~50k rows). Prompt caching helps on repeated cleanings of similar schemas.
OpenAI (GPT-5 mini)✓ SupportedExcellent for bulk. Structured Outputs enforces the transformation report schema.
Mistral (Small 3)✓ SupportedStrong support. Best-in-class for European-locale files (French dates, German number formatting).
DeepSeek (V4)✓ SupportedVia community adapter. Ultra-low cost for high-volume cleaning jobs — 200+ files per hour economically viable.
Google Gemini (3 Flash)⚠ BetaWorks via Skills beta. 1M context is useful for large single files. Occasional false positives on ambiguous dates.

10Testing & Benchmarks

98.7%
Correct transformations
0.4%
Data loss incidents
12s
Median (10k rows)
500
Test corpus files

Tested against 500 real-world messy CSVs from CRMs, spreadsheets, and third-party exports. Transformation correctness measured by human review of sample rows. Data loss incidents are cases where the cleaned file lost data that the original had (should be zero).

11Troubleshooting

The five most common issues we hit with this Skill. Each links to a full fix on our sister site.

Encoding still broken after cleanup
View fix
Dedupe removing rows that should have been kept
View fix
Dates normalized to wrong format (M/D/Y vs D/M/Y)
View fix
Excel export losing leading zeros on IDs
View fix
Categorical mapping missing rare values
View fix

Other Skills our team uses alongside CSV Data Cleaning and Normalization.

MCP servers that pair naturally with this Skill for full workflows.

14Frequently Asked Questions

Yes — idempotency is a design goal. Running twice produces the same output as running once. Every transformation is a no-op when its target state is already achieved (trimming already-trimmed whitespace changes nothing, deduping an already-deduped file changes nothing, etc.). Safe to include in ETL pipelines that may re-process files.
It asks rather than guesses. If a date column has values like "03/04/2024" that could be March 4 or April 3, the Skill flags the ambiguity and asks you to confirm the format. Without confirmation, that column is skipped and marked in the transformation report as "awaiting user input on format". Silently guessing dates is the most common way data cleaning goes wrong — this Skill refuses to do it.
Use the large-file fork. It chunks the file into batches (default 10k rows), profiles each chunk to build a consistent transformation plan, then applies the plan to every chunk. Slower than single-pass mode but handles multi-GB CSVs. All transformations remain idempotent and the report is still unified across chunks.
Two modes. If you provide a categorical_map (e.g. {"USA": "US", "United States": "US", "United States of America": "US"}), it uses that. Otherwise it auto-clusters similar-looking values and asks you to confirm the canonical form before applying. Auto-clustering catches common variants but never modifies data without confirmation.
Yes, but only if the file preserves them on input. CSV itself has no type system — a value of "00123" is indistinguishable from 123 unless quoted. If your source is Excel exported as CSV, you may lose leading zeros in the export step (Excel converts number-looking strings to numbers). The Excel-native fork reads .xlsx directly and preserves cell type, which is the reliable fix.

Hitting an error with this Skill?

Our sister site catalogs every AI Skill error — installation issues, provider incompatibilities, runtime failures — with a documented fix.

Visit AI Error Hub