THE FILE FIELD GUIDE
.csv

CSV Data

Spreadsheets

Text 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

Import CSV without changing identifiers
Situation / goalNext actionWhat to check
00123 becomes 123Use 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 garbledChoose the producer’s encoding in the import dialog.Load only after the preview shows correct text.
Everything is in one columnMatch 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.

Windows: use Excel import

Use an entry point with column-type control.

  1. Create a workbook and choose Data → From Text/CSV for a copy.
  2. Check encoding/delimiter in preview and set identifier columns to Text before loading.
  3. Verify zeros, long IDs, dates and row count; save analysis separately as XLSX.
macOS / Linux: specify text columns in Calc

Use Text Import controls.

  1. Open CSV in Calc to display Text Import.
  2. Set encoding, delimiters and quotes and mark identifier columns as Text.
  3. Verify commas/newlines inside quotes remain within the intended cell.
Mobile / other systems: check import rules first

A tabular display does not prove correct import.

  1. Retain the source and identify encoding, delimiters and column order required by both systems.
  2. Use mobile previews for inspection and desktop import when precise column types are needed.
  3. Check records, blanks, IDs and totals before operational import.

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

  1. Import with the correct encoding, delimiter and column types.
  2. Check row counts and identifiers, then save a new XLSX.
  3. 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

Related-format differences
Format / choicePurpose and preserved information
CSVDelimited text with import-controlled encoding/column types.
XLSXAnalysis workbook storing sheets, formulas and formatting.
TSVPrimarily 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: