I have the following two files ( I padded the lines with dots so every line in a file is the same width and made file1 all caps to make it more clear).contents of file1:ETIAM......SED........MAECENAS...DONEC......SUSPENDISSEcontents of file2Lorem....Proin....Nunc.....Quisque..Aenean...Nam......Vivamus..CurabiturNullam...Notice that file2 is longer than file1.When I run this command:paste file1 file2I get this outputETIAM...... Lorem....SED........ Proin....MAECENAS... Nunc.....DONEC...... Quisque..SUSPENDISSE Aenean...    Nam......    Vivamus..    Curabitur    Nullam...What can I do for the output to be as follows ?ETIAM...... Lorem....SED........ Proin....MAECENAS... Nunc.....DONEC...... Quisque..SUSPENDISSE Aenean...            Nam......            Vivamus..            Curabitur            Nullam...I tried paste file1 file2 | column -tbut it does this:ETIAM......  Lorem....SED........  Proin....MAECENAS...  Nunc.....DONEC......  Quisque..SUSPENDISSE  Aenean...Nam......Vivamus..CurabiturNullam...non as ugly as original output but wrong column-wise anyway.
A better paste command
text processing;columns;paste
Assuming you don't have any tab characters in your files,paste file1 file2 | expand -t 13with the arg to -t suitably chosen to cover the desired max line width in file1.Added by OP:I did this so it works without the magic number 13:paste file1 file2 | expand -t $(( $(wc -L <file1) + 2 ))It's not easy to type but can be used in a script.