Hi,
I have two text files, that need their data joining/concatenation. 'Paste' works for this.
But have an issue when there is mismatch in number of rows in each file.
E.g.
(main file) File1 - has 20 rows
File2 - has 30 rows.
Command 'paste file1 file2 > file3' joins all lines.
I want the output for only 20 rows, i.e. the joining for only the number of rows present in first file(file1) and dont want extra rows.
awk is the best way to go. If you want you can also use the join command but both files have to be sorted on the common key which is, in my opinion, a disadvantage compared to awk.