Combining two single column files side-by-side

Hi,

I am looking for a sed/awk script to join two large (~300 M) single column files (one is sorted and the other is not sorted) side-by-side. I have a shell script but its taking ages to do the task so looking for an optimized fast solution.

The two files look like:

File1 (sorted)
a1
a2
a3
a4

File2 (unsorted)
b1
b2
b3
b4

Desired output:
a1 b1
a2 b2
a3 b3
a4 b4

PS: the two input file are massive.

Cheers,

??? Try:

paste -d' ' file1 file2
1 Like