Files
tldr/pages.zh/common/column.md

21 lines
682 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# column
> 将 `stdin` 或文件格式化为多列。
> 列在行之前填充;默认分隔符为空格。
> 更多信息:<https://manned.org/column>。
- 为宽度为 30 个字符的显示格式化命令输出:
`printf "header1 header2\nbar foo\n" | column --output-width {{30}}`
- 自动拆分列并在表格格式中自动对齐:
`printf "header1 header2\nbar foo\n" | column --table`
-`--table` 选项指定列分隔符字符例如CSV 的 ",")(默认为空格):
`printf "header1,header2\nbar,foo\n" | column --table --separator {{,}}`
- 在填充列之前填充行:
`printf "header1\nbar\nfoobar\n" | column --output-width {{30}} --fillrows`