
CSV
CSV is a very simple file format for tables: each line is a row of the table, and commas separate the individual fields. Because almost every program can read CSV, it is the standard way to exchange data between systems.
CSV is a format for storing tables as plain text. The abbreviation stands for “Comma-Separated Values”. Each line of the file corresponds to a row of the table. Within a line, a comma separates the individual fields from one another. A file containing the prices of three stocks might look like this: “SAP,215.40,plus” on the first line, “Siemens,178.20,minus” on the second. You can open such a file with any text editor and read the content directly.
The lowest common denominator for data exchange
Data constantly needs to move from one program to the next. A bank exports account transactions, an online shop its orders, a government agency its statistics. The programs involved almost never come from the same manufacturer. CSV works anyway, because it doesn’t require any particular software, only text.
Other formats can do considerably more. An Excel file stores formulas, colors, charts, and multiple worksheets. But that is exactly what makes it complicated and tied to a specific program. CSV forgoes all of that, and in return remains readable everywhere, even twenty years from now.
For AI projects, this is especially practical. Training data is often available as huge CSV files, for example millions of rows of measurement values. Programming languages like Python have ready-made tools that can read in such files in just a few lines of code. CSV is therefore often the first step of a data analysis.
Delimiters, quotation marks, and other pitfalls
The basic principle is quickly explained. The first line usually contains the column names, for example “Name,Price,Trend”. This header line tells the reading program what is in which column. After that, the actual content follows line by line. A line break marks the end of each record.
Things get tricky when a value itself contains a comma. The company name “Meyer, Schmidt & Partner” would tear the table apart, because the program would assume a new column there. That’s why such values are enclosed in quotation marks. The reading program then knows that everything between the quotation marks belongs together.
A second stumbling block is the delimiter itself. In German-speaking countries, decimal numbers are written with a comma, i.e. 215,40 instead of 215.40. German programs therefore often use a semicolon as the separator. If you open an American CSV file in a German version of Excel, everything sometimes ends up in a single column. That’s not an error in the file, but an incorrect setting during import.
From bank accounts to training datasets
Anyone who does online banking will usually find a button for CSV export there. This allows transactions to be transferred into a budgeting program or a custom spreadsheet. Fitness apps, school administration systems, and point-of-sale systems also offer this option. The point is always to get data out of a closed system.
In the world of AI, you encounter CSV mainly with public datasets. Platforms like Kaggle or the Federal Statistical Office provide tables in exactly this way. Anyone who wants to train a model downloads the file and reads it in. Only after that does the actual work with the numbers begin.
A common misconception is that CSV is an Excel format. Excel can indeed open and save CSV, but the file doesn’t belong to any particular program. It is simply text with commas in it. This very simplicity is the reason the format has survived for more than forty years.