Chapter 14Serialization and Structure: JSON, XML, CSV

In looking at writing data in various ways, all we’ve dealt with has been the writing of unstructured text. We haven’t thought much about the form that the text takes, only the mechanism of how and where to write it. But in reality, we typically want our text to have some sort of structure, and it’s especially common for that structure to be something that a computer can read—in other words, we want the ability to write the data our program creates to a particular location, and then in the future read that data back into the program.

This process—of transforming a data structure into a format that can be written somewhere, typically to disk or over the network—is called serialization. There’s ...

Get Text Processing with Ruby now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.