How to run bash column command that after n columns it treats spaces as spaces and not as a separator?
Input:
field1 field2 field3 field 4 with spaces
foo1 foo2 foo3 foo4
bar1 bar2 bar3 bar 4 with spaces
Output:
col1 col2 col3 col4
field1 field2 field3 field 4 with spaces
foo1 foo2 foo3 foo4
bar1 bar2 bar3 bar 4 with spaces
Maybe replace spaces with other char before the column command and after that replace it again with spaces? awk or sed might be the right tool for this, but I'm not too familiar with them.
Any help is appreciated! Please, don't shoot me down. This is my first question here...