I am trying to concatenate pieces specific lines together between two files. Such that I want to add something from line 2 in file2 onto line 2 of file1. Then from line 6 from file2 onto line 6 of file 1 and so on. Is there a way to simultaneously iterate through these two files to do this? (It might be helpful to know that the input files are about 15GB each).
Here is a simplified example:
File 1:
Ignore
This is a
Ignore
Ignore
Ignore
This is also a
Ignore
Ignore
File 2:
Ignore
sentence
Ignore
Ignore
Ignore
sentence
Ignore
Ignore
Output file:
Ignore
This is a sentence
Ignore
Ignore
Ignore
This is also a sentence
Ignore
Ignore