Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

SC 3.5: Four common file layouts

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

45 minutes

One ticket, four shapes

Four systems all need the same help desk ticket: number 12, room A4, a printer jam.

One keeps it as a note. One keeps it as a row of values. Two keep it with labels in a tree.

All four are plain text you can open and read. They differ in how much structure they hold.

By the end of this lesson

Note

I can recognise four common file layouts and say when each is used.

Key words

WordWhat it meansExample
FormatThe way data is laid out in a file..csv
Text fileA file of plain characters with no set layout.notes.txt
CSVComma separated values: one record per line, fields split by commas.12,A4,printer jam
JSONText in labelled pairs inside braces, used to send data between programs.{"id": 12}
XMLText in nested tags that label each piece of data.<id>12</id>
DelimiterA mark that separates one field from the next.A comma

The cells students fill in are left blank in this preview.

Starter: what you already know

Have a go

Starter: what you already know

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Text files and CSV

A text file is plain characters. It has no rules about layout, so it suits notes, logs and readme files. Any device can open it.

A CSV file has one record on each line. A delimiter, a comma, separates the fields. Spreadsheets swap data this way. It is small and simple, but it has no types and no labels beyond a header line.

JSON and XML

JSON stores labelled pairs inside braces. It can nest one item inside another, and it is the usual shape for data sent between web programs.

XML wraps each piece of data in tags that name it. It nests deeply and describes itself, but it is longer to write.

Both are text, and both hold structure that CSV cannot.

The same ticket in four formats

FormatHow ticket 12 looks
Text fileTicket 12 from room A4: printer jam.
CSV12,A4,printer jam
JSON{"id": 12, "room": "A4", "fault": "printer jam"}
XML<ticket><id>12</id><room>A4</room><fault>printer jam</fault></ticket>

The cells students fill in are left blank in this preview.

Check: which format?

Have a go

Check: which format?

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

The lesson goes on

5 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.