1

Equal alignment of columns with tabs instead of spaces

view story
linux-howto

http://stackoverflow.com – I had a file with contents as below, with three columns which needed to be formatted/aligned: ABCD XYZAB 1234 PQRSTUV STU 9113 LMN OPRQM 8966 I came up with the following shell script: while read -r col1 col2 col3; do printf "%s%-80s%-80s\n" "$col1" "$col2" "$col3"; done <spaced-define.txt > tabbed-define.txt and managed to get them aligned like this, with spaces in between: ABCD <SPACES> XYZAB <SPACES> 1234 PQRSTUV <SPACES> STU <SPACES> 9113 LMN <SPACES> OPRQM <SPACES> 8966 What I am unable to figure out is h (HowTos)