CSV Data
SpreadsheetsText representing tabular rows and fields. Encoding and delimiter conventions can vary; automatic opening can change leading zeros or date-like values.
- What it is used for
- Exchanging tabular data
- What the file contains
- Text
All sections, questions and sources
Content reviewed: · Editor:Kai
First: choose for your purpose
CSV is tabular text. Phone numbers, codes such as 00123 and long identifiers need text import. Check encoding, delimiter and column types before a double-click triggers automatic conversion.
Import CSV without changing identifiers
| Situation / goal | Next action | What to check |
|---|---|---|
| 00123 becomes 123 | Use Data > From Text/CSV and set the identifier column to Text instead of double-clicking. | Confirm 00123 in both the import preview and loaded cells. |
| Japanese is garbled | Choose the producer’s encoding in the import dialog. | Load only after the preview shows correct text. |
| Everything is in one column | Match the delimiter to the data: comma, tab or another separator. | Check headings and field counts. |
Source for these steps:Microsoft · Import or export text (.txt or .csv) files
Opening steps
Choose your environment or purpose to see its steps.
Menu labels and support vary by app, OS and version. Preserve the original before making changes.
Practice preserving leading zeros
This original two-record CSV has identifiers 00123 and 00456. Depending on Excel’s version, use Transform Data, remove an automatic numeric conversion step if necessary, and set the column to Text.
Date-like values may also be inferred. Keep columns as Text when exact strings matter and save the checked working copy as XLSX. Reimport any CSV export to verify values.
CSV structure, UTF-8 encoding and both identifier values are checked; import in an installed Excel application has not been tested here.
Source for these steps:Microsoft · Import or export text (.txt or .csv) files / IETF · RFC 4180 — CSV
Troubleshooting by symptom
- For garbled text, retry the import with the correct encoding rather than saving the corrupted interpretation.
- A single column can mean a different delimiter. Naive splitting mishandles quoted commas/newlines.
- Long IDs end in zeros: numeric precision/automatic conversion may have altered them; reimport source as text.
- 1-2 becomes a date: specify Text before importing; changing display format afterward may not recover it.
- Another system rejects the output: compare delimiters, line endings, quotes, encoding and order rather than applying naive replacements.
CSV → XLSX
- Import with the correct encoding, delimiter and column types.
- Check row counts and identifiers, then save a new XLSX.
- Decode output in the intended encoding and inspect records, quoting, leading zeros and final data.
XLSX saving cannot restore zeros lost during import. Keep the CSV and treat identifiers as text.
Preserving identifiers
00123 is not equivalent to integer 123 for an identifier. Postal, employee and account codes can require exact digits/leading zeros.
Inspect source text and set column types before importing; reimport rather than cosmetically fixing already altered IDs.
Source for these steps:Microsoft · Import or export text (.txt or .csv) files / The Document Foundation · Text Import
Checking re-export
CSV omits colors, charts and multiple worksheets; exports may contain displayed values instead of formulas. Check recipient expectations.
Quoted commas/newlines can be data. Compare all records/columns, blanks and the final entries.
Source for these steps:IETF · RFC 4180 — CSV
Related-format differences
| Format / choice | Purpose and preserved information |
|---|---|
| CSV | Delimited text with import-controlled encoding/column types. |
| XLSX | Analysis workbook storing sheets, formulas and formatting. |
| TSV | Primarily tab-delimited text requiring different delimiter settings. |
Handling and security
Spreadsheet apps may interpret formula-like fields. Review import settings and avoid enabling external actions from unknown CSVs.
Questions and answers
Why did phone-number zeros disappear?
The column may have been imported as numbers. Re-import the original as text.
Is CSV an Excel-specific format?
No. It is a text interchange format used by many applications.
Can CSV contain worksheets?
It has no workbook sheet structure; exchange separate tables as separate files.
Can formatting restore 00123 after conversion to 123?
Known-width formatting can change appearance, not prove the source value; reimport as text.
Can I split CSV manually at every comma?
Quoted commas/newlines require a CSV-aware importer.
Format facts: name, steward and MIME type
- Formal name
- Comma-Separated Values
- Steward / specification
- IETF RFC 4180 (Informational)
- MIME type
- text/csv
Primary and official sources
- StandardRFC 4180 — CSV
Informational RFC describing CSV quoting, separators and media type.
IETF · Link checked: - Software documentationText Import
Documents CSV encoding, delimiters and text-column settings.
The Document Foundation · Link checked: - Software documentationImport or export text (.txt or .csv) files
Importing text with delimiter and column-type control.
Microsoft · Link checked: