Stockertim Dictionary · Technology
CSV file
Also called comma-separated values, CSV format, CSV files
In short
A comma-separated values file: plain text in which each line is a row of a table and commas separate the columns; the most common format for exchanging tabular data.
- Advanced
- Technology
- Checked
In detail
A CSV file stores a table as plain text. The first line usually holds column headings, and each following line is one record, with fields separated by commas. A price file might begin with date, open, high, low, close and volume, followed by one line per trading day. Because it is just text, any spreadsheet, database, statistics package or programming language can read and write it, and it can be opened in a basic text editor to inspect what is really there.
That simplicity hides several traps. A field that itself contains a comma, such as a company name, must be enclosed in quotation marks. Some countries use the comma as a decimal mark and the semicolon as a separator. There is no built-in record of data types, so a spreadsheet may turn codes with leading zeros into numbers, convert some codes into dates, or read 1/2/2026 as January or February depending on settings. Text encoding matters too: currency signs and accented names can garble if the file is read with the wrong encoding, and UTF-8 is the usual safe choice.
Good practice is to use unambiguous ISO dates (2026-11-04), a full stop as the decimal mark, UTF-8 encoding and a header row, and to document what each column means. Reading CSV files with code rather than opening and resaving them in a spreadsheet avoids silent changes. For large or complex data, formats that store types and compress well may suit better, but CSV remains the common language of data exchange.
Worked example
A CSV file of daily prices contains these lines: date,close then 2026-11-02,104.50 then 2026-11-03,106.59.
- Read the two closing prices from the second column
- Daily return: (106.59 / 104.50) − 1 = 2.0%
A few lines of plain text are enough for any tool to load the data and calculate a return.
In practice
Statistics offices, central banks and exchanges offer downloads in CSV, and UK government guidance names CSV as an open standard for tabular data. Analysts load CSV files into spreadsheets, databases and code for cleaning and analysis.
Watch out
- Opening and resaving a CSV in a spreadsheet can silently change codes, dates and leading zeros.
- Check the separator, decimal mark and text encoding before trusting the numbers.
Learn it properly
- Lab 1: reading CSV files in Python and SQL15 min lesson Free course: Financial Data Lab
- How data is organised: tables, rows, columns and keys15 min lesson Free course: Data skills: SQL and Python basics
- pandas basics and a first chart15 min lesson Free course: Data skills: SQL and Python basics
- Choosing tools and working out the costs15 min lesson Free course: AI for small business
- Lab 5: cleaning corporate actions in code15 min lesson Free course: Financial Data Lab
Official sources
- API technical and data standards · Government Digital Service
- Tabular data standard · Government Digital Service (GOV.UK)
Facts last checked on 4 November 2026.
Education, not advice: the Stockertim Dictionary explains what terms mean. It never recommends buying or selling anything.