column - columnate lists

( a verb. not a noun COLUMNS)

column [-tx ] [-c width] [-s sep] [file …]

Formats its input into multiple columns by removing sep and inserting spaces or [TAB] 0x09 characters to try to align columns!
Beware of headings or footings which confuse column See example

Default: Rows are filled down before columns across.
↓1  4  7  
 2  5  8
 3  6  
-x columns across before filling rows down.
 1 →  2   3   
 4    5   6   
 7    8   
-c width total width of display in characters ( even if output is to a file) (does not RESTRICT output to width, but may increase the number of columns shown!
default $COLUMNS environment variable.
        some telnet programs change COLUMNS if screen size is changed.
 > echo $COLUMNS
100
 > column f
172.17.55.206   172.17.55.211   172.17.55.216   172.17.55.221   172.17.55.226   172.17.55.231
172.17.55.207   172.17.55.212   172.17.55.217   172.17.55.222   172.17.55.227   172.17.55.232
172.17.55.208   172.17.55.213   172.17.55.218   172.17.55.223   172.17.55.228   172.17.55.233
172.17.55.209   172.17.55.214   172.17.55.219   172.17.55.224   172.17.55.229   172.17.55.234
172.17.55.210   172.17.55.215   172.17.55.220   172.17.55.225   172.17.55.230
 > column -c128 f
172.17.55.206   172.17.55.210   172.17.55.214   172.17.55.218   172.17.55.222   172.17.55.226   172.17.55.230   172.17.55.234
172.17.55.207   172.17.55.211   172.17.55.215   172.17.55.219   172.17.55.223   172.17.55.227   172.17.55.231
172.17.55.208   172.17.55.212   172.17.55.216   172.17.55.220   172.17.55.224   172.17.55.228   172.17.55.232
172.17.55.209   172.17.55.213   172.17.55.217   172.17.55.221   172.17.55.225   172.17.55.229   172.17.55.233
-t Determine the number of columns the input contains and create a table.
-s sep set of characters to delimit columns for -t . default whitespace (?)
-oosep osep is used as output seperator (in some versions!)
> cat f
AFPServer:AFPUserAliases:Aliases:AppleMetaRecord:Augments:Automount:AutomountMap:b:Beta:biglonghairyword:tiny
RFPServer:RFPUserAliases:Rliases::Rugments:Rutomount:RutomountMap:b:Beta:biglonghairyword:tiny:fairlysmall:00

> column  -t f
AFPServer  AFPUserAliases  Aliases  AppleMetaRecord  Augments   Automount     AutomountMap  b     Beta              biglonghairyword  tiny
RFPServer  RFPUserAliases  Rliases  Rugments         Rutomount  RutomountMap  b             Beta  biglonghairyword  tiny              fairlysmall  00

Empty lines are ignored.

Column exits 0 on success, >0 if an error occurred.

ENVIRONMENT
$COLUMNS defines width

EXAMPLES

> (printf "PERM LINKS OWNER GROUP SIZE MONTH DAY HH:MM/YEAR NAME\n" \
  ; /bin/ls -l | /bin/sed 1d    ) | column -t  
PERM        LINKS  OWNER     GROUP    SIZE    MONTH  DAY  HH:MM/YEAR  NAME
-rw-r--r--  1      me        users    1613    Feb    9    17:28       0
-rwxr-xr-x  1      me        users    650     Nov    5    08:29       0.pl
-rw-r--r--  1      me        users    1470    Feb    9    17:28       00
-rw-r--r--  1      me        users    712     Oct    1    17:07       0920a
-rw-r--r--  1      me        users    658     Oct    1    17:07       0920b
-rw-r--r--  1      me        users    299     Jun    11   2007        0badPairing.txt
-rw-r--r--  1      me        users    151     Dec    15   2007        0datetime.txt
( sed 1d deletes TOTAL .. line )
 

SEE ALSO colrm, ls , paste, sort, stty oxtabs (-oxtabs). Expand (do not expand) tabs to spaces on output.