SQL to CSV Formatter
100% PrivateData & JSON ToolsTurn pasted SQL terminal output into a proper CSV file you can open in a spreadsheet.
Runs entirely in your browser. Your input is not uploaded to Ovatly or anywhere else.
- 1Copy the query output from your terminal and paste it here.
- 2Leave the format on Auto-detect, or pick the format yourself if detection picks wrong.
- 3Press Convert to CSV and check the detected format shown above the result.
- 4Copy the CSV or download it as query-result.csv.
Worked example
MySQL ASCII table
Input: +----+-------+ | id | name | +----+-------+ | 1 | Ana | | 2 | Ben | +----+-------+ Output: id,name 1,Ana 2,Ben
- Supported pasted formats: ASCII tables with +---+ borders and | cells (MySQL style), psql tables with a dashed separator using + joins, whitespace-aligned columns with a dashed separator line, tab or semicolon delimited text, and columns separated by two or more spaces as a fallback.
- Cell values are trimmed of the padding spaces the terminal added. Values that genuinely start or end with spaces lose them; there is no way to tell the difference in pasted output.
- Trailing summary lines such as (3 rows) or 3 rows in set are removed. NULL values are copied as the literal text your client printed.
Yes, when there is a dashed separator line under the header: its dash runs define the column boundaries. Without a separator, use two-or-more-space separation or re-run the query with a delimiter.
About this tool
The SQL to CSV Formatter rescues data trapped in terminal output: paste the ASCII table from a MySQL or psql session, aligned columns with a dashed separator, or delimited text, and get a proper CSV file out.
Related tools
CSV to JSON ConverterConvert pasted or uploaded CSV into a JSON array, with header handling built inData & JSON ToolsOpenCSV Viewer and EditorView CSV as an editable, sortable table grid you can filter and fix in placeData & JSON ToolsOpenData Deduplicator and CleanerRemove duplicate lines or CSV rows from pasted data and clean what remainsData & JSON ToolsOpenJSON to CSV ConverterConvert a JSON array of objects into a spreadsheet-ready CSV fileData & JSON ToolsOpen
Advertisement
Part of Ovatly's free tools in Data & JSON Tools.