I have two files. file_1.txt looks like this:
R1 C1 C2 C3 C4 C5
R2 C1 C2 C3 C4 C5
R3 C1 C2 C3 C4 C5
R4 C1 C2 C3 C4 C5
R5 C1 C2 C3 C4 C5
R6 C1 C2 C3 C4 C5
R7 C1 C2 C3 C4 C5
R8 C1 C2 C3 C4 C5
R9 C1 C2 C3 C4 C5
R10 C1 C2 C3 C4 C5
file_2.txt looks like this:
R4 C4 C5
R6 C4 C5
R7 C4 C5
R9 C4 C5
I would like to replace the C4 and C5 values in file_1.txt by those that correspond to them from file_2.txt, while keeping the C1, C2, and C3 values in file_1.txt unchanged.
So the resulting file_3.txt should look like this:
R1 C1 C2 C3 C4 C5
R2 C1 C2 C3 C4 C5
R3 C1 C2 C3 C4 C5
R4 C1 C2 C3 C4_new C5_new
R5 C1 C2 C3 C4 C5
R6 C1 C2 C3 C4_new C5_new
R7 C1 C2 C3 C4_new C5_new
R8 C1 C2 C3 C4 C5
R9 C1 C2 C3 C4_new C5_new
R10 C1 C2 C3 C4 C5
All values are numbers. The first columns in file_1.txt and file_2.txt are key fields and are sorted in ascending numerical order.
Is this something that join alone can do?