CSV Cleaner API
Clean CSV: trim cells, drop empty rows and columns, remove duplicate rows, rename headers, fix ragged rows and drop columns. Returns the cleaned CSV and a report of what changed.
POST /api/v1/tools/csv-cleanerMCP csv_cleanerData & ConversionClean messy CSV in your browser. Trim cells, drop empty rows and columns, remove duplicates, tidy header names, fix ragged rows and change the delimiter.
Input
Send these as a JSON object. Unknown fields are rejected.
- input
- The CSV text. (string, required)
- delimiter
- Input delimiter: "auto" to detect, or a single character such as "," ";" "|" or a tab. (string, up to 4 characters, default "auto")
- outputDelimiter
- Output delimiter: "same" keeps the input one, or a single character. (string, up to 4 characters, default "same")
- header
- Treat the first row as a header row (kept, never de-duplicated). (boolean, default true)
- trim
- Trim whitespace around every cell. (boolean, default true)
- removeEmptyRows
- Drop rows where every cell is blank. (boolean, default true)
- removeEmptyColumns
- Drop columns where every data cell is blank. (boolean, default false)
- removeDuplicates
- Drop repeated data rows, keeping the first. (boolean, default false)
- duplicateKeys
- Comma-separated 1-based column numbers that identify a duplicate, e.g. "2" for the second column. Empty compares whole rows. (string, up to 500 characters, default "")
- ignoreCase
- Ignore letter case when finding duplicates. (boolean, default false)
- headerStyle
- Rename headers: keep, snake (first_name) or title (First Name). (string, one of keep, snake, title, default "keep")
- ragged
- Rows with a different number of cells: keep as they are, pad short rows to the widest row, or fit every row to the first row's width. (string, one of keep, pad, fit, default "keep")
- removeColumns
- Comma-separated 1-based column numbers to drop, e.g. "3, 5". (string, up to 500 characters, default "")
- crlf
- Use CRLF line endings instead of LF. (boolean, default false)
curl https://pithlab.com/api/v1/tools/csv-cleaner \n -H "Authorization: Bearer $PITHLAB_KEY" \n -H "Content-Type: application/json" \n -d '{"input":" Name , Email \nAda, [email protected] \n\nAda,[email protected]\nAlan,[email protected]","removeDuplicates":true,"headerStyle":"snake"}'