I typically use column
to convert input into a table, eg:
$ echo 'a\tb\tc\nd\te\tf' | column -t -s $'\t'
a b c
d e f
However it collapses empty columns eg:
$ echo 'a\tb\tc\nd\t\tf' | column -t -s $'\t'
a b c
d f
Rather than printing an empty column when there are consecutive delimiters. This is what I would like, using column
or otherwise:
a b c
d f
echo
tryprintf
– Romeo Ninov Jan 23 '19 at 11:53-e
is implied. We have a whole family of duplicate Q&As about that, starting from https://unix.stackexchange.com/questions/65803/ . But that is not the focus of this question, which is about thecolumn
command. Imagine that the input of thecolumn
command is whatever is necessary to yield TAB-delimited fields within LF-delimited records, some of which are empty. – JdeBP Jan 23 '19 at 12:14