← Back to guides

How to remove null rows from CSV

Use a deliberate workflow: define null-like values, sanitize first, then remove rows with predictable checks.

1) Define what counts as a null row

Decide if null-like values include blank cells, only delimiters, or tokens like NA, null, and N/A. Consistent definitions improve repeatability.

2) Clean before removing

Normalize null-like strings and whitespace first so rows that “look” valid are not accidentally removed.

3) Remove and verify

Remove rows in one pass and compare row counts before/after. Keep a sample of source and cleaned rows for audit.

4) Example: null-like token policy

If your file uses mixed missing-value conventions, define a single mapping before cleanup: ["", " ", "-", "NA", "N/A", "NULL", "null", "None"]. This avoids accidental row retention due to formatting differences.