I need to paste two columns (in a file) to a very big file with an identical number of columns (length 48554). I have tried this
I have two files with columns separated by tabs. File 1 looks like this:
Header_1 header_2
0 23
1 25
and file 2 looks like this:
Header_3 header_4
2 24
3 26
What I want is this:
Header_1 header_2 Header_3 header_4
0 23 2 24
1 25 3 26
I have tried paste, e.g. this:
paste file1 file2 | pr -t -e24
- but I get this:
Header_1 header_2
0 23
1 25 Header_3
header_4
2 24
3 26
i.e, the problem is that paste appends the new columns in file 2 to the bottom of the last column in file 1, not added side by side as two extra columns in the +5000 column matrix as I need.
What am I doing wrong?
gives this output:
Your AWK suggestion gives this output:
I made the files in excel, and saved them as tab-separated txt files - I have verified the hidden codes and tabular separations. It´s simply that nothing is working. :(
– Christoffer Bugge Harder Oct 27 '19 at 23:06paste file1 file2 | pr -t s24
although thepr
doesn't seem to do anything on my system...... – bu5hman Oct 28 '19 at 16:49