How to Format CSV Text with Custom Delimiters and Quotes
Paste the CSV text, match the delimiter and quote character to the source, choose a formatting mode, and run the formatter. It rewrites parsed rows and reports their row count plus the largest observed row width.
When to use the formatter
CSV Formatter rewrites CSV text according to the delimiter, quote character, and formatting mode you select. This makes it useful when the source uses separators other than commas, when quoted fields need a particular quote character, or when you want to inspect a rewritten version of the same parsed rows. The default configuration uses a comma delimiter, a double-quote character, and pretty formatting. The input is text, so include the portion you want processed rather than assuming the tool will identify settings from a file name or surrounding context. Keep the source structure in mind while choosing the controls: the selected delimiter and quote character determine how nonblank input is parsed before it is written again. The formatter is therefore best used with settings that match the syntax of the CSV text you provide.
Format CSV text step by step
-
Paste the CSV text into the input area. Include the header and data rows when they belong to the content you want to process. Blank or whitespace-only input follows a separate successful path and produces empty formatted content with zero rows and zero columns.
-
Choose the delimiter placed between fields in the source. Leave the comma selected for comma-separated text, or select the character that actually separates fields in your input.
-
Set the quote character used around CSV values. The default is the double-quote character; change it when the source uses another character.
-
Select the formatting mode. The exact value
minimaluses minimal CSV quoting. Every other formatting value uses quoting for every field, so a different label should not be treated as a separately verified quoting style. -
Run the formatter, then inspect the rewritten CSV and the reported counts. For nonblank input, processing parses rows with the selected delimiter and quote character and rewrites those parsed rows with the chosen settings. If the output does not look right, compare the controls with the source syntax before making further changes.
Interpret the formatted result
Read the formatted content together with the row and column counts. When processing completes without an exception, the row count describes the parsed rows, while the column count is the largest row width observed in that input. A two-line comma-separated input with three fields on each line is counted as two rows and three columns. That measurement does not establish that every row has the same width, and it does not certify that the text satisfies a particular CSV standard.
An exception follows a different result boundary. The response can still be successful while the formatted content is empty, both counts are zero, and an error description is provided. Use that description to identify what needs attention, then review the delimiter, quote character, and structure of the submitted text. For a successful nonblank result, compare representative rows in the rewritten content with the source to confirm that the selected settings match your intended interpretation.
Worked example
A user checks the parsed dimensions of a small comma-separated list before using its rewritten CSV content.
Paste name,city,score and Maya,Denver,94, keep the comma delimiter and double-quote character, leave the formatting mode at its default, and run the formatter.
The response contains rewritten CSV content, a row count of 2, a column count of 3, and no exception error when both lines parse as three comma-separated fields.
Limitations
- The column count represents the largest row width observed, and an exception result uses zero rows and columns, so counts need to be read alongside the rewritten content and any error description.
Common errors
- A delimiter or quote character that does not match the source can cause an exception, which returns empty content and zero counts. Select the characters used by the input and run the formatter again, then inspect the returned error description if the issue remains.
FAQ
What happens if I leave the CSV input empty?
Blank or whitespace-only input produces a successful response with empty formatted content and zero rows and zero columns. Text containing visible CSV characters is processed under the selected settings instead.
What delimiter and quote character should I choose?
The default delimiter is a comma, and the default quote character is a double quote. Select different controls when those characters do not represent the separators and quote marks in the source text.
How do I control CSV quoting?
The exact value minimal selects minimal CSV quoting. A different formatting value uses quoting for every field rather than a separately verified quoting mode.