How to clean a CSV without losing rows
A clean export is not just a file that opens. A defensible cleanup preserves the source, applies explicit rules, reconciles every row, and records what changed.
Effective October 23, 2026
1. Preserve the original
Keep the source file unchanged and compute a digest before transformation. Write the cleaned output to a separate file so every result can be traced back to the supplied input.
2. Validate the structure first
- Confirm a single header row and record the column count.
- Check that each data row has the expected number of fields.
- Record encoding and delimiter assumptions instead of silently guessing.
- Flag malformed rows rather than forcing them into a valid-looking shape.
3. Apply only deterministic cleanup rules
Trim permitted surrounding whitespace, remove wholly blank rows, and remove only exact full-row duplicates. Do not merge similar names, infer missing values, normalize business identifiers, or fuzzy-match records unless those rules are separately defined and reviewed.
4. Reconcile the row counts
The basic control is simple: input data rows minus blank rows minus exact duplicate rows must equal output data rows. If the equation does not balance, stop and investigate before releasing the file.
5. Produce an auditable change ledger
Record the applied rule, affected-row count, before-and-after shape, unresolved exceptions, and output digest. The ledger should explain every structural change without copying sensitive row content.
What the $39 starter includes
One non-sensitive CSV up to 1,000 data rows and 25 columns, deterministic structural cleanup, a validation report, and a change ledger. It excludes sensitive or regulated data, fuzzy matching, enrichment, business-rule inference, manual record research, and production-system writes.
Inspect the synthetic before-and-after sample · Describe one non-sensitive CSV and review the $39 scope
A G.B. Industry company