title: Return the next 4 lines after a match has been found
body: <p>Hope you guys can help. I am currently learning python and stumped by this challenge I have set myself. </p>
  
  <p>I have a file1 with approx 1000 lines of text like this:  </p>
  
  <pre><code>1 6  
  4 6  
  1 4  
  2 4  
  1 5  
  4 6  
  3 6  
  1 3  
  2 4  
  ..etc etc
  </code></pre>
  
  <p>I have another file2 with 4 (or more) lines of text like this:  </p>
  
  <pre><code>4 6  
  1 4  
  2 4  
  1 5  
  </code></pre>
  
  <p>I am trying to find the exact match in file1 with the 4 lines of text in file2 and then return the next 4 lines that follow the match in file1. So in the above example, the return would read:  </p>
  
  <pre><code>4 6  
  3 6  
  1 3  
  2 4  
  </code></pre>
  
  <p>The problem I am having is trying to search for the 4 lines in file1. A single file is easy. I am thinking it will be done using loops but the more I try the cloudier my head becomes! </p>
  
  <p>The closest I have come is this code:</p>
  
  <pre class="lang-py prettyprint-override"><code>textfile = ('results.txt', 'wt')
  file1 = open("small_sample.txt", "r")
  file2 = open("demo.txt", "r")
  file3 = open("results.txt", "a")
  list1 = file1.readlines()
  list2 = file2.readlines()
  file3.write("The following entries appear in both lists: \n")
  for i in list1:
      for j in list2:
          if i==j:
              file3.write(i)
  </code></pre>