2016-09-22 15:20:03 +01:00
|
|
|
# column
|
|
|
|
|
2021-03-31 11:45:02 +01:00
|
|
|
> Format standard input or a file into multiple columns.
|
|
|
|
> Columns are filled before rows; the default separator is a whitespace.
|
2021-04-12 07:54:04 +01:00
|
|
|
> More information: <https://manned.org/column>.
|
2016-09-22 15:20:03 +01:00
|
|
|
|
2021-03-31 11:45:02 +01:00
|
|
|
- Format the output of a command for a 30 characters wide display:
|
2016-09-22 15:20:03 +01:00
|
|
|
|
2021-03-31 11:45:02 +01:00
|
|
|
`printf "header1 header2\nbar foo\n" | column --output-width {{30}}`
|
2016-09-22 15:20:03 +01:00
|
|
|
|
2021-03-31 11:45:02 +01:00
|
|
|
- Split columns automatically and auto-align them in a tabular format:
|
2016-09-22 15:20:03 +01:00
|
|
|
|
2021-03-31 11:45:02 +01:00
|
|
|
`printf "header1 header2\nbar foo\n" | column --table`
|
2016-09-22 15:20:03 +01:00
|
|
|
|
2021-08-15 18:59:09 +01:00
|
|
|
- Specify the column delimiter character for the `--table` option (e.g. "," for CSV) (defaults to whitespace):
|
2019-05-16 21:46:41 +01:00
|
|
|
|
2021-03-31 11:45:02 +01:00
|
|
|
`printf "header1,header2\nbar,foo\n" | column --table --separator {{,}}`
|
2019-05-16 21:46:41 +01:00
|
|
|
|
2021-03-31 11:45:02 +01:00
|
|
|
- Fill rows before filling columns:
|
2016-09-22 15:20:03 +01:00
|
|
|
|
2021-03-31 11:45:02 +01:00
|
|
|
`printf "header1\nbar\nfoobar\n" | column --output-width {{30}} --fillrows`
|