Convert ECSV to CSV
Convert Astropy ECSV tables to widely compatible CSV while checking lost metadata and data types.
Make CSV files online
We can't read ECSV files yet, so this conversion isn't available. If you can export your work to one of these formats - or others - we'll turn it into CSV:
Want to convert ECSV to CSV?
Let us know. We pick the conversions to add next by how many people ask for them.
How to convert ecsv to csv file
- Documents
- No ratings yet.
Scientific software often produces ECSV, while spreadsheet, database, and reporting applications commonly require ordinary CSV. Converting it makes the table easier to share and edit, but removes metadata that CSV cannot store.
What ECSV is
ECSV means Enhanced Character-Separated Values. It is a text-table format developed for the Astropy ecosystem and used mainly in astronomy and other scientific data workflows.
An ECSV file combines a YAML-style metadata header with delimited table data. The header can define column names, data types, units, descriptions, null handling, and other Astropy table metadata. A typical file begins with # %ECSV 1.0. ECSV can use commas, tabs, or another delimiter, so the file extension alone does not determine the separator.
Astropy writes this format from astropy.table.Table objects with format='ascii.ecsv'. Microsoft Excel and most general spreadsheet applications do not natively interpret the ECSV header as a table.
What CSV is
CSV stores one record per line, with fields separated by commas. A field containing a comma, quotation mark, or line break is normally enclosed in double quotation marks, and an embedded quotation mark is represented by two quotation marks.
CSV is supported by LibreOffice Calc, Microsoft Excel, database importers, programming libraries, and many web services. It is simpler and often smaller than ECSV, but it does not normally preserve units, descriptions, Astropy-specific data types, masks, provenance, or custom table metadata. CSV has common conventions rather than one completely uniform implementation, so applications can disagree about encoding, line endings, delimiters, and missing values.
Convert with Astropy
Astropy is the safest option because it reads the ECSV schema instead of treating the metadata header as ordinary data.
Install Astropy:
python -m pip install astropyRun this command from the directory containing the source file:
python -c "from astropy.table import Table; Table.read('input.ecsv', format='ascii.ecsv').write('output.csv', format='ascii.csv', overwrite=True)"This reads input.ecsv and writes a comma-delimited output.csv. The overwrite=True option replaces an existing output file; omit it if accidental replacement should be prevented.
For repeated conversions, save the following as convert_ecsv.py:
from astropy.table import Table
table = Table.read('input.ecsv', format='ascii.ecsv')
table.write('output.csv', format='ascii.csv', overwrite=True)Run it with:
python convert_ecsv.pyIf the source uses an unusual ECSV feature or contains masked values, inspect the resulting table and adjust the Astropy table before writing. Do not remove comment lines manually unless the file is a simple, known layout; doing so can lose column definitions or leave the data misaligned.
Use desktop and online tools
Use LibreOffice Calc or Microsoft Excel to inspect the generated CSV, not to parse the original ECSV. Open the result through File → Open, select comma as the delimiter when prompted, and check the detected types. When saving again, choose CSV and confirm comma as the delimiter and UTF-8 as the encoding where the application offers those settings. Locale-specific spreadsheet settings may otherwise produce semicolon-separated output or alter decimal and date values.
There is no broadly supported, ECSV-specific web converter that reliably preserves Astropy schemas. For a browser-based conversion, Google Colab is a practical online option: create a notebook, run !pip install astropy, upload the ECSV file, and execute the same Table.read(...).write(...) code. Do not upload confidential or regulated data to Colab or a third-party converter. Generic CSV websites such as Zamzar or Convertio should be used only if their current format list explicitly accepts ECSV; otherwise they may copy the YAML header into the output or interpret it as data.
Check the converted file
Compare the input and output column counts and row counts, then inspect the header, delimiter, character encoding, missing-value representation, and decimal separator. Open the CSV with a CSV-aware program because splitting lines manually breaks fields that contain quoted commas or line breaks.
The conversion cannot carry ECSV metadata into a normal CSV file. Preserve the original ECSV and record units, descriptions, provenance, and data types separately if they are needed for scientific interpretation.
Scalar numeric, text, and date-like columns usually convert directly. Multidimensional columns, quantities, masked columns, complex values, and custom Astropy objects may not have one portable CSV representation. Flatten or serialize those columns explicitly and verify the resulting values before importing the CSV into another application.
ECSV vs CSV: format comparison
How the ECSV and CSV formats compare on the properties that matter most for this conversion.
| Property | .ECSV Enhanced Character Separated Values | .CSV Comma-Separated Values |
|---|---|---|
| Open standard | Yes | Yes |
| Compression | Uncompressed | Uncompressed |
| Typical file size | Small | Small |
| Opens in a web browser | Yes, natively | Yes, natively |
| Further editing | Easy | Easy |
| Metadata support | Extensive | Basic |
| Plain-text readable | Yes | Yes |
| Best used for | Data exchange | Data exchange |
| Introduced | 2018 | — |
| Developer | Astronomical Data Center / Astropy community | — |
| MIME type | text/csv | text/csv |
Information about file extensions and file types is provided by File-Extensions.org
Suggested software and links: ecsv to csv converters
Additional formats for
ecsv file conversion
Reverse conversion
Convert to csv from
other formats
- arff to csv
- docx to csv
- txt to csv
- xlsx to csv
- xls to csv
- excel to csv
- sdf to csv
- lvm to csv
- jrprint to csv
- doc to csv
- 123 to csv
- bgl to csv
- colpkg to csv
- cwk to csv
- dif to csv
- gsheet to csv
- gtable to csv
- html to csv
- iwa to csv
- numbers to csv
- ods to csv
- odt to csv
- ott to csv
- oxps to csv
- pdf to csv
- pmd to csv
- prnx to csv
- rtf to csv
- skv to csv
- slk to csv
- sor to csv
- sxc to csv
- tsv to csv
- uos to csv
- wk1 to csv
- wk4 to csv
- wpd to csv
- wr1 to csv
- wri to csv
- xfdl to csv
- xlsb to csv
- xlsm to csv