Part 3Load: Writing Text
We’ve looked at how to read text into our programs and at how to manipulate that text once we’ve read it. The final logical step that we can expect to need to take is to write our processed text somewhere.
This might seem a simple subject, but there’s much to get our teeth into. First, we’ll look at writing to standard output and to files. Then we’ll explore writing to other processes, something that will allow us to exploit the power of text processing pipelines from within our programs. After looking at how to write to structured formats such as JSON, XML, and CSV, we’ll finish up by using ERB to create flexibly templated output.
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