tldr/pages/common/column.md
Lena d427f333b2
pages/*: add backticks around I/O streams (#10436)
* as suggested in #10428
* standard input  => `stdin`
* standard output => `stdout`
* standard error  => `stderr`

Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2023-08-09 10:59:02 +05:30

748 B

column

Format stdin or a file into multiple columns. Columns are filled before rows; the default separator is a whitespace. More information: https://manned.org/column.

  • Format the output of a command for a 30 characters wide display:

printf "header1 header2\nbar foo\n" | column --output-width {{30}}

  • Split columns automatically and auto-align them in a tabular format:

printf "header1 header2\nbar foo\n" | column --table

  • Specify the column delimiter character for the --table option (e.g. "," for CSV) (defaults to whitespace):

printf "header1,header2\nbar,foo\n" | column --table --separator {{,}}

  • Fill rows before filling columns:

printf "header1\nbar\nfoobar\n" | column --output-width {{30}} --fillrows