Export to CSV

Export to CSV, dump to CSV and unload to CSV all mean the same thing: write data out to a CSV (Comma-Separated Values) file. "Export" is the general word, "dump" usually means a raw bulk extract from a program or database, and "unload" is the term cloud warehouses such as Amazon Redshift use. This page covers all three, from a single spreadsheet to a terabyte table.

CSV's strength is its simplicity: fields separated by commas, rows by line breaks, plain text with no proprietary formatting. That makes it lightweight, easy to parse, and readable by every spreadsheet, database and programming language - which is why it is still the default format for moving data between systems.

When you export to CSV

  • Migration & cross-software sharing. Native formats are often incompatible (Excel's .xlsx, database internals, API JSON). CSV is the "universal bridge": export an Excel sheet to CSV for Python/R, export a website's user data for a CRM, or move a table between two databases.
  • Backup & archiving. CSV is smaller than Excel or database files (no formatting, formulas or macros), stays readable even if the original software disappears, and is far harder to corrupt than a binary file.
  • Data cleaning & preprocessing. Exporting "flattens" data to pure rows and columns - formulas become values, formatting is dropped - so tools like Pandas, R or SQL can read, filter and deduplicate it quickly.
  • Analytics & data lakes. Dump a fact table to CSV in object storage (S3/GCS) to join with logs and event data, or unload historical data to compressed CSV for cheap long-term retention and compliance.
  • Sharing with partners. A CSV in secure storage can be handed to a vendor or auditor without giving them direct database access.

How to export to CSV, by source

Excel and spreadsheets

In Excel: File → Save As → CSV UTF-8 (Comma delimited). In Google Sheets: File → Download → Comma-separated values. For batch conversion of many files, use Excel to CSV.

Databases (GUI, no coding)

Withdata's DB-to-CSV tools export a table, a query or a whole schema to CSV through a point-and-click GUI, with batch and scheduled-task support:

Prefer to do it in the browser? The free online converter turns CSV, Excel, JSON, XML and SQL into each other with nothing uploaded.

Command-line one-liners

  • PostgreSQL: psql -c "\copy (SELECT * FROM t) TO 'out.csv' CSV HEADER"
  • MySQL: SELECT ... INTO OUTFILE '/tmp/out.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM t; (or mysqldump --tab)
  • SQLite: sqlite3 -csv -header db.sqlite "SELECT * FROM t" > out.csv
  • MongoDB: mongoexport --db=d --collection=c --type=csv --fields=a,b,c --out=out.csv
  • SQL Server: bcp "SELECT * FROM t" queryout out.csv -c -t, -T

From code

In Python, df.to_csv('out.csv', index=False) dumps a Pandas DataFrame to CSV; the built-in csv module writes lists and dicts. This is the usual way to "dump" API responses or log data to CSV for later analysis.

Very large tables

For huge tables (100M+ rows) export in chunks - by id range or date - so each file stays manageable, and gzip the results. As a reference, in our CSV vs JSON vs XML benchmark gzip shrank a 100,000-row CSV by roughly 5x.

CSV gotchas

  • Encoding. Save as UTF-8. For Excel on Windows, choose UTF-8 with BOM so accented and non-Latin text is not garbled.
  • Separator. Use a comma, or a tab if your data contains many commas (that is a TSV). Some locales expect ; - match your audience.
  • Quoting. Wrap fields that contain the separator, quotes or line breaks in double quotes, and double any embedded quote (RFC 4180).
  • Large files. Split and compress; avoid opening a multi-GB CSV in Excel.

Do it with Withdata

Whether you need a one-off export or a nightly scheduled dump, Withdata covers desktops and servers:

FAQ

Is "export to CSV" the same as "dump to CSV" or "unload to CSV"?
Yes - they all mean writing data to a CSV file. "Export" is general, "dump" is a raw bulk extract, "unload" is the cloud-warehouse term.

How do I export a database table to CSV without coding?
Use a DB-to-CSV GUI tool such as MySQL to CSV or the online converter.

Why does Excel show my CSV in one column?
The separator does not match - use a comma, or Data → From Text/CSV and pick the delimiter.