--table-noextreme
选项如何column
工作?
-E, --table-noextreme columns Specify columns where is possible to ignore unusually long (longer than average) cells when calculate column width. The option has impact to the width calculation and table formatting, but the printed text is not affected.
$ cat table.md
Lorem ipsum | Lorem ipsum dolor sit amet | Lorem ipsum dolor sit amet | Lorem ipsum dolor sit amet
Lorem | Lorem ipsum | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut | Lorem ipsum dolor
Lorem | Lorem ipsum dolor | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do | Lorem
$ column -t -s '|' -o '|' < table.md
Lorem ipsum | Lorem ipsum dolor sit amet | Lorem ipsum dolor sit amet | Lorem ipsum dolor sit amet
Lorem | Lorem ipsum | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut | Lorem ipsum dolor
Lorem | Lorem ipsum dolor | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do | Lorem
$ column -t -s '|' -o '|' --table-noextreme 3 < table.md
Lorem ipsum | Lorem ipsum dolor sit amet | Lorem ipsum dolor sit amet | Lorem ipsum dolor sit amet
Lorem | Lorem ipsum | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut | Lorem ipsum dolor
Lorem | Lorem ipsum dolor | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do | Lorem
我怎样才能让它格式化表格
Lorem ipsum | Lorem ipsum dolor sit amet | Lorem ipsum dolor sit amet | Lorem ipsum dolor sit amet
Lorem | Lorem ipsum | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut | Lorem ipsum dolor
Lorem | Lorem ipsum dolor | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do | Lorem
(来自 util-linux 2.37.2/arch 的列)