Example 1: Trim stray whitespace and normalize quoting
Hand-edited CSVs often carry leading spaces after commas and inconsistent quoting. The formatter drops the extra spaces and re-quotes only the fields that need it.
Input
id, name , city
1, Alice ,"Seoul"
2, "Smith, John" , Tokyo
3,Carol, "Berlin"
Output
id,name,city
1,Alice,Seoul
2,"Smith, John",Tokyo
3,Carol,Berlin
Example 2: Switch delimiter and sort headers
A semicolon-separated European export converts to comma output while the header row is alphabetized. Row values stay aligned with their headers.
Input
name;age;city
Alice;30;Seoul
Bob;25;Tokyo
Output
age,city,name
30,Seoul,Alice
25,Tokyo,Bob