CSV Ragged Row Padder

Repair rows with inconsistent column counts: pad short records, handle over-long records, preserve CSV quoting, and get a report of every fix.

Try:
Repaired CSV

Repair CSV rows with inconsistent column counts

Paste a CSV, TSV, semicolon file, or pipe-delimited table whose rows do not all have the same number of fields. This tool normalizes the table to a target width: short rows get padded with blank cells (or your pad value), while rows with too many fields can be truncated, merged into the final column, flagged in a report, or dropped.

It preserves CSV quoting with the Rust csv parser/writer instead of splitting on commas by hand, so fields like "New York, NY" stay intact. Use it before importing messy exports into spreadsheets, databases, warehouse loaders, validation suites, or command-line tools that reject ragged records.

Worked example

Input:

name,email,age
Ada,[email protected],37
Grace,[email protected]
Linus,[email protected],54,extra

With Infer width from set to Header row, Long rows set to Truncate extras, and an empty Pad value, the repaired CSV is:

name,email,age
Ada,[email protected],37
Grace,[email protected],
Linus,[email protected],54

Choose Output → Repair report first when you want to audit what changed before exporting the repaired CSV.

Controls and limits

FAQ

Why do CSV rows become ragged?

Common causes are missing trailing delimiters, broken exports, hand-edited files, optional columns, unescaped commas, or concatenating data from different schemas. This tool fixes the row-width problem after the CSV parser has interpreted the quoting and delimiter structure.

Should I truncate, merge, flag, or drop long rows?

Use flag when auditing unknown data, because it leaves long rows intact and lists them. Use merge when the extra fields are really part of the final free-text column. Use truncate only when extras are known junk, and drop when long rows are invalid records you want removed.

What does “infer width from mode” mean?

Mode picks the most common row width. It is useful when the header is missing or broken and most data rows already have the right shape. Ties choose the wider width so fewer values are discarded.

Will quoted commas or tabs be preserved?

Yes. Delimiter sniffing counts delimiters outside quotes, and the repair step uses the Rust CSV reader and writer. Quoted fields are parsed as cells, then re-quoted as needed in the output.

Can this fix malformed quoting?

No. If the input has broken quotes that the CSV parser cannot read, the tool reports a parse error. Fix quoting first, then use this tool to normalize the number of fields per row.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool csv-ragged-row-padder "name,email,age
Ada,[email protected],37
Grace,[email protected]
Linus,[email protected],54,extra"

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/csv-ragged-row-padder/?input=name%2Cemail%2Cage%0AAda%2Cada%40example.com%2C37%0AGrace%2Cgrace%40example.com%0ALinus%2Clinus%40example.com%2C54%2Cextra&width=0&width_from=header&long_rows=truncate&pad_value=NULL&header=true&delimiter=auto&drop_empty_rows=true&line_ending=lf&output=csv

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.