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
For a quick-and-dirty fix, pipe it through column:
your_program | column -t
If you need to include spaces in the column data, then delimit the fields with some character such as "|" and:
your_program | column -t -s "|"
You can use any character for a delimiter and specify it with the -s switch. Control characters are possible but a little trickier to work with.
But as Jay mentioned you're better off fixing your program to format the output properly.