Merging information from multiple files to a single file

Hello,

I am new to unix and need help with a problem. I have 2 files each containing multiple columns of information ie;

File 1 :
A B C D E
1 2 3 4 5

File 2 :
F G
6 7

I would like to merge the information from File 2 to File 1 so that the data reads as follows;

File 1:
A B C D E F G
1 2 3 4 5 6 7

I am thinking of using the "Shift" command but i am not too sure. Is there an easier method? If there are any example for future reference i would be very grateful

man paste
??

Use paste command.

paste file1 file2

To get the exact required output, you need to specify the delimiter in "paste" (in this case a space character).

paste -d " " file1 file2
1 Like

Thanks methyl worked a dream :slight_smile: