Importing data from a CSV file

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Importing data from a CSV file

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What does CSV stand for?
A Computer saved version
B Comma separated values
2. Which line is shown the way a CSV file stores a row of data?
A Mia 11 Melbourne |
B Mia,11,Melbourne
3. A CSV file is a plain text file.
A True
B False
4. You download a list of school sports results as a CSV file. Which program can open it and show the data in rows and columns?
A A spreadsheet
B A music player
5. When a spreadsheet opens a CSV file, what does each comma tell it to do?
A Start a new column
B Start a new spreadsheet

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1name,age,team AThe values are separated by spaces, not commas. A spreadsheet would put each whole line in one cell instead of splitting it into columns.
2Mia,11,Blue BOne row of data in a CSV file. A spreadsheet puts Mia, 11 and Blue into three cells side by side.
3A CSV file is saved with a file name ending that tells the computer it holds comma separated values CThe first row of a CSV file with three headings separated by commas. A spreadsheet shows each heading in its own column.
4A CSV file stores a small table as plain text, with one line for each row and commas between the values DA word processor shows only the plain text and commas. A spreadsheet is the tool that opens a CSV file and lays the data out in rows and columns.
5name age team Mia 11 Blue Epet,count dog,8 cat,5
6Open the CSV file in a word processor to see the data in rows and columns Fsurvey_results.csv

Definitions

CSV file

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
A CSV file is stored as plain ____
2.
Open the CSV file in a ___________
3.
CSV means Comma _________ Values
4.
Each comma starts a new ______
5.
Downloaded file: data.___

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A Name,Age,Pet
B Mia 10 dog
C Leo,11,cat
Question 2
A Fruit,Price
B apple,2
C banana 3
Question 3
A Name,Score,Team
B Ava,9
C Sam,7,Blue
Question 4
A Day,Rain,,Temp
B Mon,0,22
C Tue,5,19
Question 5
A Download the file data.docx
B Open a new spreadsheet
C Choose File, then Import
D Pick data.csv from Downloads

Answer Key

Importing data from a CSV file
Section A: Quick Questions
Q1
B — Comma separated values
Q2
B — Mia,11,Melbourne
Q3
A — True
Q4
A — A spreadsheet
Q5
A — Start a new column
Section B: Match the Pairs
Q1
name,age,team → The first row of a CSV file with three headings separated by commas. A spreadsheet shows each heading in its own column.
Q2
Mia,11,Blue → One row of data in a CSV file. A spreadsheet puts Mia, 11 and Blue into three cells side by side.
Q3
A CSV file is saved with a file name ending that tells the computer it holds comma separated values → survey_results.csv
Q4
A CSV file stores a small table as plain text, with one line for each row and commas between the values → pet,count dog,8 cat,5
Q5
name age team Mia 11 Blue → The values are separated by spaces, not commas. A spreadsheet would put each whole line in one cell instead of splitting it into columns.
Q6
Open the CSV file in a word processor to see the data in rows and columns → A word processor shows only the plain text and commas. A spreadsheet is the tool that opens a CSV file and lays the data out in rows and columns.
Section C: Definitions
Q1
CSV file — A plain text file that stores table data with commas between the values. A spreadsheet can open it and show the data in rows and columns.
Section D: Fill in the Blanks
Q1
A CSV file is stored as plain text
Q2
Open the CSV file in a spreadsheet
Q3
CSV means Comma Separated Values
Q4
Each comma starts a new column
Q5
Downloaded file: data.csv
Section E: Spot the Error
Q1
B — A CSV file puts commas between values, not spaces. A spreadsheet would put all of this text in one cell. It should be Mia,10,dog.
Q2
C — The values must be separated by a comma so the spreadsheet knows where the next column starts. It should be banana,3.
Q3
B — This row is missing the Team value. Every row needs the same number of values as the headings. It should be Ava,9,Red.
Q4
A — Two commas in a row make an empty extra column. The heading line should have just one comma between each heading. It should be Day,Rain,Temp.
Q5
A — A CSV file ends in .csv. A .docx file is a word processing document, not comma separated table data. It should be data.csv.