I would like to merge specific columns from two txt files containing varying number of rows, but same number of columns (as shown below):
file1:
xyz desc1 12
uvw desc2 55
pqr desc3 12
file2:
xyz desc1 56
uvw desc2 88
Preferred output:
xyz desc1 12 56
uvw desc2 55 88
pqr desc3 12 0
Currently I use the paste command using awk as:
paste <(awk '{print $1}' file1) <(awk '{print $2}' file1) <(awk '{print $3}' file1) <(awk '{print $3}' file2)
But this seems to merge only columns that overlap. Is there a way in awk to insert zeros instead of omitting the row itself?
I need to combine 100 files together such that my output file will contain 102 columns.