Skip to the workspace
Pebellslearn by building
Data Collection  ›  Lesson

CSV Files

CSV Files 12 minA CSV file is plain text with one record per line and fields separated by commas, so its structure is only as reliable as the program that wrote it.

data analyst / CSV Files

Explore each scene at your own pace.

01 · The rule

The rule

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-02 and 1e5 are 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 ₹.
Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.