Chapter 10Reading and Writing Files
Data is often stored in plain-text files, which can be organized in several different ways. For example, the rainfall amounts in Oregon for each separate day in a study period might be stored one value per line in a file, using a newline as a delimiter to separate the values and make the data easier for humans to read. Alternatively, each line might store the values for an entire week or month, separating values within a line using a delimiter such as a space, tab, or comma.
Often, data organization is more complex. For example, a study might keep track of the heights, weights, and ages of the participants. Each record can appear on a line by itself, with the pieces of data in each record separated by delimiters. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access