How can I clean up misaligned columns in text?

前端 未结 6 723
佛祖请我去吃肉
佛祖请我去吃肉 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:43

    Here's a awk solution : c_prog | awk '{ printf("%- 40s %- 40s\n", $1, $2); }'

提交回复
热议问题