bash align output columns code example
Example: bash display properly aligned columns
# Basic syntax:
column -t input_file
# Example usage:
# Say you have a file that contains the following text. Even though the
# columns are tab-delimited, they aren't aligned well and it's difficult
# to read them.
a bdstdydgfhgjhdgfhgjh c
d e f
g h i
# After running column -t input_file on your file, you'd see:
a bdstdydgfhgjhdgfhgjh c
d e f
g h i
# Note, if you want to see fields without any wrapping, you can also
# pipe to less -S. E.g.:
column -t input_file | less -S