colm.icn: Program to arrange data into columns

December 5, 1989; Robert J. Alexander
This file is in the public domain.
Program to arrange a number of data items, one per line, into
multiple columns. Items are arranged in column-wise order, that is,
the sequence runs down the first column, then down the second, etc.

If a null line appears in the input stream, it signifies a break in
the list, and the following line is taken as a title for the
following data items. No title precedes the initial sequence of
items.

Usage:

      colm [-w line_width] [-s space_between] [-m min_width]
              [-t tab_width] [-x] [-d] [file ...]

 The parameters are:

      line_width:     the maximum width allowed for output lines
                      (default: 80).
      space_between:  minimum number of spaces between items
                      (default: 2).
      min_width:      minimum width to be printed for each entry
                      (default: no minimum).
      tab_width:      tab width used to entab output lines.
                      (default: no tabs).
      -x              print items in row-wise order rather than
                      column-wise.
      -d (distribute) distribute columns throughout available width.

 The command "colm -h" generates "help" text.

 This is a  general utility,  but  it  was  written and tailored for a
 specific purpose:

 This  utility  was written  to rearrange the file name  list from the
 Macintosh  Programmer's   Workshop  "Files"  command  into   a   more
 convenient  format.  "Files" lists  file  names in a  single  column.
 This program  takes  the  list  produced by  "Files"  and  outputs  a
 multi-column  list.  The  names  are  listed  vertically within  each
 column, and  the column width is computed dynamically  depending upon
 the sizes  of the  names listed.  A  recommendation  is  to create  a
 command file "lc" (List in Columns) as follows:

      Files {"Parameters"} | colm

 The output from  the  Files command  is "piped" to the "colm" program
 (this program), which prints its list in the current window.

 By  putting both  the "lc"  command  file and the "colm" program into
 your {MPW}Tools folder, "lc" can be conveniently issued  as a command
 at any time, using the same parameters as the "Files" command.

Source code | Program Library Page | Icon Home Page