Chapter 12Standard Output and Standard Error

We’ve completed two pieces of our puzzle: acquiring text and processing it. The final part of a text processing job is usually to output the text somewhere—the “load” part of the “extract, transform, load” process.

There’s a bewildering array of places we might want to write our text to and formats in which we might want to write it: to the screen or to files; in JSON or as a CSV; as simple output or using complex, interpreted templates.

The place of first resort, though—for the simplest scripts and at the earliest point of even complex applications—is to write to standard output. We investigated its sibling, standard input, in Chapter 2, Processing Standard Input, where we used it to read text ...

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.