Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Padding printed output of tabular data

I know this is probably dead simple, but I've got some data such as this in one file:

Artichoke

Green Globe, Imperial Star, Violetto

24" deep

Beans, Lima

Bush Baby, Bush Lima, Fordhook, Fordhook 242

12" wide x 8-10" deep

that I'd like to be able to format into a nice TSV type of table, to look something like this:

    Name  | Varieties    | Container Data
----------|------------- |-------
some data here nicely padded with even spacing and right aligned text 
like image 303
The Pied Pipes Avatar asked Mar 02 '09 16:03

The Pied Pipes


1 Answers

another gem: https://github.com/visionmedia/terminal-table Terminal Table is a fast and simple, yet feature rich ASCII table generator written in Ruby.

like image 98
yang Avatar answered Oct 25 '22 04:10

yang