table: Format a list of words into a table

Package: lists

Usage

table input_files

Parameters

input_files
List of files to be formatted, may be STDIN.
first_col = 7
Offset to first column of table
last_col = 0
Offset to last column of table. The value last_col = 0 indicates right margin.
ncols = 0
Number of columns. The value ncols = 0 indicates maximum that will fit.
maxstrlen = 0
Maximum string length for table entry. The value maxstrlen = 0 indicates no limit.

Description

Task table reads a list of strings from the standard input or a list of files and assembles a nicely formatted table. If reading from multiple input files, make a separate table for each. There is no fixed limit to the size of the table which can be formatted. The table is not sorted; this should be done as a separate operation if desired.

Examples

1. Format a file containing names into a two column table. The table is sorted alphabetically first.

cl> sort names | table ncols=2

See also

words, tokens