title: Replace certain line in a text with a certain line in another text
body: <p>Taking off from <a href="https://stackoverflow.com/questions/26009752/replace-line-in-text-file-with-line-from-other-text-file">this question</a>, I want to replace a certain line in one text file with another line from another text file. Example:</p>
  
  <p>text1 contains:</p>
  
  <pre><code>line 1
  line 2
  line 3
  </code></pre>
  
  <p>text2:</p>
  
  <pre><code>line 4
  line 5
  line 6
  </code></pre>
  
  <p>I want to replace the 2nd line in text1 with the second line from text2, the solution in the above mentioned question works by adding all the content of text2 in place of the line to be changed, not a certain line against a certain line.</p>
  
  <p>The actual problem I'm having is that I have two files, one contains a list of data that need to run through the same command in another file, I'm looking for a method of automation, a script that automatically replaces a certain string in the second file with the first line in the first file then replaces the same string with the second line and go on.. not sure how to do that but I thought if I could work out that sed command I could probably just make copies of it equal to the number of lines that I have and run them in sequence.</p>