Formatting Output with Tables
In Chapter 4, Play Well with Others, we discussed using CSV format to organize output, where each line would represent a record and each comma-separated value would represent a field. We even updated todo to use this format to make it easier to integrate with other programs. Humans have a hard time reading CSV-formatted data, instead finding it easier to view such data in a tabular format. This is why spreadsheet programs like Microsoft Excel can import CSV files and display their data in tables. It’s also why most SQL database clients show their output in tables; it’s a great way to look at a lot of data in an organized fashion.
Using the gem terminal-table, it’s very easy to produce tabular output from our ...
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