Answers for "bash display properly aligned columns"

2

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
Posted by: Guest on September-27-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language