CSVians AI / Guides
Clean a messy CSV
Spaces, case, blanks and inconsistent spelling — fixed with plain-English rules.
What "messy" usually means
Most messy CSVs share the same handful of problems: values with leading or trailing spaces, the same city spelled three ways, blank cells that look empty but contain a space, and columns where text and numbers are mixed together.
A safe cleaning order
- Trim whitespace first. Spaces are invisible, so they cause failed matches later. Ask: “Trim leading and trailing spaces in every text column.”
- Standardise letter case. Pick one convention per column, for example lowercase emails and title-case names. State it explicitly: “Lowercase the email column. Title-case customer_name.”
- Normalise blanks. Decide whether empty strings, “N/A”, “-” and “null” should all become truly empty cells, and say so in your rules.
- Fix one column at a time. Small, verifiable rules beat one giant “clean everything” request.
Example prompt
“Trim spaces in all text columns. Lowercase email. In the city column, map ‘NYC’, ‘New York City’ and ‘new york’ to ‘New York’. Turn ‘N/A’ and empty strings into blank cells. Do not delete any rows.”
Verify before you trust it
Run the tool on a sample, then open the Compare view. Check that row counts match, that no valid value was blanked out, and that identifiers kept their leading zeros. If something looks wrong, ask the chat to adjust the rule and rerun — that loop is the normal workflow, not a failure.