← VCE Data Analytics U3O1

Dataset file formats: CSV, XLSX, JSON and XML

The way a dataset's data is structured and stored in a file, such as CSV, XLSX, JSON or XML. Choose the format that suits the software you will open it in.

Understanding Dataset file formats: CSV, XLSX, JSON and XML in VCE Data Analytics U3O1

What it does: JSON uses braces, quoted keys and values so each record is labelled with its field names. XML wraps every data value in tags that name the field, such as <mark> and </mark>. CSV (comma-separated values) is plain text, with one row per line and commas between the values. XLSX is an Excel workbook, which is not plain text. XLSX stores sheets, formulas, formatting and charts. CSV stores only the raw values in a single table. Spreadsheets open CSV and XLSX directly. XML and JSON usually need converting or special import steps first. JSON stores nested key-value data and is widely used by web apps and APIs. CSV is a flat table with no nesting.

Common mistakes: In a CSV file every row needs the same number of comma-separated fields as the header. This row is missing the English mark and should be Mia,95,89. JSON does not allow a trailing comma after the last item in an object. The line should be "english": 74 with no comma.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 17–49) and word search (Modules 17–91).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which file format stores data as plain text with values separated by commas?
CSVXLSX
Matches
Choosing a CSV file because you need to keep formulas and cell colours
↓
CSV is plain text and only stores values, so formulas and formatting are lost. XLSX should be chosen to keep them.
Applying
Meanings
Term
file format
Meaning
The way a dataset's data is structured and stored in a file, such as CSV, XLSX, JSON or XML. Choose the format that suits the software you will open it in.
Practice
Name,Maths,English,Science
Testing
Gaps
Plain text, comma separated: data.
Check Answer
Spots
3Liam,65,70
4Mia,95

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Wolverine' badge — Fearless Coder, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which file format stores data as plain text with values separated by commas?
A. CSV ✓
B. XLSX
CSV (comma-separated values) is plain text, with one row per line and commas between the values. XLSX is an Excel workbook, which is not plain text.
2. Which file format is an Excel workbook that can hold several sheets, formulas and formatting?
A. XLSX ✓
B. CSV
XLSX stores sheets, formulas, formatting and charts. CSV stores only the raw values in a single table.
3. Which snippet is JSON?
A. <student><name>Ava</name></student>
B. {"name": "Ava", "mark": 88} ✓
JSON uses curly braces and key: value pairs. The other snippet uses opening and closing tags, which is XML.
4. Which snippet is XML?
A. Name,Mark Ava,88
B. <student><name>Ava</name></student> ✓
XML wraps each piece of data in opening and closing tags. The other snippet is CSV: a header row with comma-separated values.
5. You want to open a downloaded dataset in a spreadsheet and keep it simple. Which format is the better choice?
A. CSV or XLSX ✓
B. XML only
Spreadsheets open CSV and XLSX directly. XML and JSON usually need converting or special import steps first.

Match the Pairs

results.csv → A plain text file where each row is a record and the values in a row are separated by commas
results.xlsx → An Excel workbook file that stores data in sheets and can also keep formulas and cell formatting
JSON stores data as key and value pairs inside curly braces → {"name": "Ava", "mark": 88}
XML stores each value between opening and closing tags → <mark>88</mark>
Choosing a CSV file because you need to keep formulas and cell colours → CSV is plain text and only stores values, so formulas and formatting are lost. XLSX should be chosen to keep them.
Name,Maths,English;Ava,88,74;Liam,65,70 → A CSV file uses commas between values and a new line for each record, not semicolons between records.

Key Term

file format
The way a dataset's data is structured and stored in a file, such as CSV, XLSX, JSON or XML. Choose the format that suits the software you will open it in.

Fill in the Blanks

1. Plain text, comma separated: data.csv
Hint: Type the file extension for a comma-separated values file
2. Excel workbook with sheets: marks.xlsx
Hint: Type the file extension used by modern Excel workbooks
3. Key-value data for web apps: feed.json
Hint: Type the file extension for JavaScript Object Notation
4. <student><name>Ava</name></student>
Hint: Type the element name that closes the matching opening tag
5. <?xml version="1.0"?>
Hint: Type the keyword that declares this tag-based format at the top of a file

Spot the Error

Question 1
A Name,Maths,English
B Ava,88,74
C Liam,65,70
D Mia,95
Line D — In a CSV file every row needs the same number of comma-separated fields as the header. This row is missing the English mark and should be Mia,95,89.
Question 2
A {
B "name": "Ava",
C "maths": 88,
D "english": 74,
E }
Line D — JSON does not allow a trailing comma after the last item in an object. The line should be "english": 74 with no comma.
Question 3
A <student>
B <name>Ava</Name>
C <maths>88</maths>
D </student>
Line B — XML tags are case-sensitive, so the closing tag must match the opening tag exactly. It should be </name>.
Question 4
A import csv
B f = open('marks.csv')
C rows = json.load(f)
D for r in rows:
E print(r)
Line C — marks.csv is a CSV file, so it must be read with a CSV reader. The line should be rows = csv.reader(f), because json.load only reads JSON.
Question 5
A [
B {"id": 1, "mark": 88},
C {id: 2, "mark": 65}
D ]
Line C — In JSON every key must be written in double quotes. The line should be {"id": 2, "mark": 65}.

Student with a class code? Join your class →