CSV Files
Nisha's delivery partner emails a weekly file called deliveries.csv. It opens in a spreadsheet, a database, Python or R, which is exactly why every system can export one. That same simplicity is why CSV files cause some of the most confusing bugs an analyst meets.
The rule
A CSV is just text: one line per row, commas between fields.
Open one in a plain text editor and you see this:
order_id,order_date,customer,item_code,qty,amount
1001,2025-06-02,Asha Rao,C01,2,240
1002,2025-06-02,Vikram Shah,C02,3,120
1006,2025-06-05,"Rao, Kiran",B01,1,90- The first line is usually the header: the column names.
- Each following line is one row; each comma starts a new field.
- A field that itself contains a comma is wrapped in double quotes, as in
"Rao, Kiran". A double quote inside a quoted field is written twice:"".
What a CSV does not store matters just as much:
- No data types.
00123,2025-06-02and1e5are all just characters. The program opening the file guesses what they are. - No formatting, formulas or multiple sheets. Only the values.
- No declared encoding or separator. Most files are UTF-8 with commas, but some regions use semicolons, and a wrong encoding turns
₹into junk like₹.