How to review CSV cleaning without losing information

Cleaning a spreadsheet is a series of decisions about meaning. A tidy-looking export can still be wrong if leading zeros disappear, dates change interpretation or distinct records get merged.

By Luke Kevin McLaughlin, IndepApps · Updated

1. Keep the source and define the columns

Work on a copy. Record what one row represents and which columns identify it. In the synthetic example below, customer_id is text, not a number; a blank amount means unknown, not zero.

customer_id,region,amount,visit_date
00124,North,120.00,2026-08-04
00125,north , ,2026-08-05
00126,South,0,2026-08-06

This is an illustrative dataset, not a customer export or a benchmark of an app.

2. Separate safe formatting from ambiguous changes

Removing unintended outer whitespace from a region label can be a reasonable rule. Converting every identifier to a number is not: 00124 becomes 124. Decide whether north and North refer to the same business category before combining them.

Mixed dates such as 04/08/2026 are ambiguous without a locale. Do not pick an interpretation from appearance alone. Keep unresolved values and ask the source owner; use an explicit format such as YYYY-MM-DD once the meaning is known.

3. Review the difference before accepting

Tidyset proposes deterministic changes and shows a before-and-after difference. Review the affected cells, not just the action label. A useful change log records the column, rule, number of affected cells and reason for the rule.

  • Confirm that leading zeros survive in identifiers.
  • Keep empty amounts distinct from explicit zero amounts.
  • Check unexpected categories before replacing them.
  • Define duplicate keys before removing rows. Two identical-looking purchases may be separate events.

4. Validate the export and replay cautiously

Compare row counts, distinct identifiers, missing-value counts and relevant totals before and after. A formatting-only rule should not silently change the row count or the sum of valid numeric amounts. Open the exported file in its destination tool and confirm its encoding, delimiter and column types.

Save the accepted steps as a recipe, then inspect a later export before replaying it. New columns, changed date formats or a different unit can invalidate a previously useful rule. Keep the source, cleaned output and recipe together.

Choose the right next tool

Use Tidyset for reviewable cleaning, Alembic for supported dataset-preparation workflows, or Dash Weaver to build a dashboard from prepared data. Compare Mac data tools before choosing.