How can I clean up misaligned columns in text?

前端 未结 6 660
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-31 09:08

I have a C program that outputs two columns, utterly misaligned. The reason for the misalignment is lengths of words in the first column are very different.

I have an o

6条回答
  •  孤街浪徒
    2021-01-31 09:59

    I just add missing in another answers options:

    Emacs with M-x align-regexp, M-x align-string, etc. read more at http://www.emacswiki.org/emacs/AlignCommands

    POSIX shell (possibly build-in) command printf:

    while read f1 f2 f3 tail; do printf "%10s %5s | %s" $f1 $f3 $tail; done 

提交回复
热议问题