title: Search text file and insert line
body: <p>What I want to do is (using the text below as an example), search for the string “Text2” in a text file, and then insert a line (“Inserted Text”) two lines after "Text 2". “Text 2” could be on any line in the text file but I know it will appear once within the text file.</p>
  
  <p>So here’s the original file:</p>
  
  <pre><code>Text1
  Text2
  Text3
  Text4
  </code></pre>
  
  <p>And here’s what I want:</p>
  
  <pre><code>Text1
  Text2
  Text3
  Inserted Text
  Text 4
  </code></pre>
  
  <p>So I already know how to add text above a line using the code below.</p>
  
  <pre><code>for line in fileinput.input('file.txt', inplace=1,backup='.bak'):
      if line.startswith('Text 4'):
          print "Inserted Text"
          print line,
      else:
          print line,
  </code></pre>
  
  <p>But I just don't know how to add something two lines after the text I'm searching for in the file.</p>