Docs

Data Cleaner

Trim, drop empties, normalize line endings, rename duplicate headers.

Overview

Cleans a CSV: trims whitespace, drops empty rows/columns, normalizes line endings, renames duplicate headers. Does not deduplicate rows.

Features

  • Trim whitespace.
  • Drop empty rows/columns.
  • Normalize line endings.
  • Rename duplicate headers.

Use cases

  • Tidying an export.
  • Normalizing a Windows CSV.

API reference

POST /api/v1/tools/data-clean

Trim whitespace, drop empty rows and columns, normalize line endings, and rename duplicate headers in a CSV.

Returns: The cleaned CSV text and a summary of what was changed.

Parameters

NameTypeRequiredDefaultDescription
input string Yes — The CSV to clean.
options.trimWhitespace boolean No true Trim leading/trailing whitespace in every cell.
options.dropEmptyRows boolean No true Drop rows where every cell is empty.
options.dropEmptyColumns boolean No true Drop columns where every cell is empty.
options.normalizeLineEndings boolean No true Normalize CRLF/CR to LF.
options.deduplicateHeaders boolean No true Rename duplicate header names (the second "id" becomes "id_2"). Set false to keep the names exactly as they appear in the file. Does not deduplicate rows.

Example

curl -X POST https://data-migration-tools.com/api/v1/tools/data-clean \
  -H "Content-Type: application/json" \
  -d '{"input":"id,name\n1,Ada\n1,Ada\n2,"}'

See the full API reference for all examples and error codes.