Home
cd ../playbooks
Data & ReportingBeginner

Data Cleanup & Formatting

Clean, standardize, and validate messy data files — fix formats, remove duplicates, and get analysis-ready datasets.

5 minutes
By communitySource
#data-cleanup#csv#formatting#standardization#data-quality

80% of your analysis time is spent cleaning data, not analyzing it. Dates are in 4 formats, company names have 3 spellings each, there are 200 duplicates, and someone entered 'N/A' in a numeric field. You can't trust insights from data you can't trust.

Who it's for: data analysts spending most of their time cleaning before analyzing, operations teams receiving messy data exports from multiple systems, researchers standardizing datasets from different sources, marketing teams cleaning CRM data for segmentation, anyone who receives CSVs and spreadsheets that need serious cleanup before use

Example

"Clean up this customer database export" → Cleaned dataset: dates standardized to ISO format, 150 duplicates merged, company names normalized, 30 invalid emails flagged, missing fields filled where inferrable, and a data quality report showing before/after statistics

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

Or install from your terminal:
npx ccplaybooks add recipe-data-cleanup
# Data Cleanup & Formatting

## Your Role
You are an expert data analyst and quality specialist. Your job is to clean, standardize, and validate messy datasets while maintaining complete traceability of all changes.

## Core Principles
- Never modify source files — always create new cleaned versions
- Document every change in a detailed change log
- Flag ambiguous items for human review rather than guessing
- Validate output (row counts, totals) against source data
- Apply consistent standards across all fields

Get new playbooks like this one

One email a week with new Claude Code workflows. Free, like everything here.

No spam. Unsubscribe anytime.

README.md

What This Does

Takes messy CSV/Excel files with inconsistent formats, duplicates, and errors, and produces clean, standardized, analysis-ready data. Includes a detailed change log so you know exactly what was modified. Handles what used to take hours of manual cleanup.


Quick Start

Step 1: Download the Template

Click Download above to get the CLAUDE.md file.

Step 2: Place Your Data File

Put the messy CSV or Excel file in your working directory.

Step 3: Start Using It

claude

Say: "Clean up customers.csv — standardize dates to YYYY-MM-DD, fix phone numbers, remove duplicates, and flag missing emails"


What Gets Cleaned

Area Before → After
Dates "Jan 5, 2024" / "1/5/24" → "2024-01-05"
Phone numbers "(555) 123-4567" / "5551234567" → "+1-555-123-4567"
Names "john smith" / "JOHN SMITH" → "John Smith"
Duplicates 3 entries for same person → 1 merged record
Missing values Empty fields → Flagged for review
Whitespace Extra spaces, line breaks → Clean text

Output Files

## What You Get
1. cleaned-customers.csv — Ready for analysis
2. change-log.md — Every modification documented
3. data-quality-report.md — Issues found and resolved
4. review-needed.csv — Rows requiring human judgment

Tips

  • Never overwrite source data: Always create a new "cleaned" file
  • Start with 100 rows: Verify rules work before processing the full dataset
  • Save your standards: Create a "data-standards.md" for reuse across projects
  • Validate results: Check row counts and totals match the original

Commands

"Clean and standardize this CSV file"
"Show me all duplicate entries in this dataset"
"Standardize all dates to ISO format (YYYY-MM-DD)"
"Generate a data quality report for this file"

Troubleshooting

Lost rows after cleanup Check the change log — duplicates may have been merged. Say: "Show me which rows were merged"

Wrong format applied Specify exactly: "Use MM/DD/YYYY for dates, not ISO format"

Too many flagged items Set thresholds: "Only flag rows missing more than 3 fields"

$Related Playbooks

Data & Reporting

Data Quality Assessment

Assess data quality across completeness, accuracy, consistency, and timeliness with remediation priorities.

10 minutes
Intermediate
Data & Reporting

Executive Summary Generator

Distill detailed reports into concise executive summaries with key findings, implications, and decision recommendations.

5 minutes
Beginner
Data & Reporting

KPI Variance Analysis & Commentary

Generate variance analysis commentary explaining why KPIs deviated from targets with root causes and corrective actions.

10 minutes
Intermediate
Data & Reporting

Scientific Dask

Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For...

10 minutes
Intermediate
Data & Reporting

Scientific Datacommons Client

Work with Data Commons, a platform providing programmatic access to public statistical data from global sources. Use this skill when working with demographic data, economic indicators, health statistics, environmental data, or any public datasets ...

10 minutes
Intermediate
Data & Reporting

Scientific Exploratory Data Analysis

Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats. This skill should be used when analyzing any scientific data file to understand its structure, content, quality, and characteristics. Automatically ...

10 minutes
Intermediate
Data & Reporting

Scientific Geomaster

Comprehensive geospatial science skill covering remote sensing, GIS, spatial analysis, machine learning for earth observation, and 30+ scientific domains. Supports satellite imagery processing (Sentinel, Landsat, MODIS, SAR, hyperspectral), vector...

5 minutes
Beginner
Data & Reporting

Scientific Geopandas

Python library for working with geospatial vector data including shapefiles, GeoJSON, and GeoPackage files. Use when working with geographic data for spatial analysis, geometric operations, coordinate transformations, spatial joins, overlay operat...

10 minutes
Intermediate
Data & Reporting

Scientific Hypogenic

Automated LLM-driven hypothesis generation and testing on tabular datasets. Use when you want to systematically explore hypotheses about patterns in empirical data (e.g., deception detection, content analysis). Combines literature insights with da...

15 minutes
Advanced
Data & Reporting

Scientific Infographics

'Create professional infographics using Nano Banana Pro AI with smart iterative refinement. Uses Gemini 3 Pro for quality review. Integrates research-lookup and web search for accurate data. Supports 10 infographic types, 8 industry styles, and co...

10 minutes
Intermediate
Data & Reporting

Report Automation Designer

Design automated reporting systems with data flow mapping, template creation, and delivery scheduling.

15 minutes
Intermediate
Data & Reporting

Survey Results Analyzer

Analyze survey responses to identify themes, segment insights, and generate executive-ready reports with visualizations.

10 minutes
Beginner

Browse all Data & Reporting playbooks →