title: Filtering a large file returns an empty new file
body: <p>I'm new to python, so forgive me if this question is too basic.
  I've been trying to filter rows in a large file (> 85,000,000 rows) using paterns in another file (around 100,000 rows). I want to read these files, line by line to save memory, and writing the filtered rows to another file.
  The large file has text such as:</p>
  
  <pre class="lang-none prettyprint-override"><code>21:10433614:T:A 21  10433614    T   A   Biallelic_SNP   0.00075642965204236 0   0   0   0   0.000199680511182109
  21:10433615:G:T 21  10433615    G   T   Biallelic_SNP   0.00302571860816944 0   0   0   0   0.000798722044728434
  21:10433619:T:A 21  10433619    T   A   Biallelic_SNP   0   0   0.00496031746031746 0   0   0.000998402555910543
  21:10433640:G:A 21  10433640    G   A   Biallelic_SNP   0   0   0   0   0.00204498977505112 0.000399361022364217
  21:10433654:C:T 21  10433654    C   T   Biallelic_SNP   0   0   0   0.00397614314115308 0   0.000798722044728434
  rs201609931:10434436:CAT:C  21  10434436    CAT C   Biallelic_INDEL 0.0219364599092284  0   0   0.00198807157057654 0   0.0061900958466453`7
  </code></pre>
  
  <p>And the patterns are like this:</p>
  
  <pre><code>21 10433614
  21 10433619
  21 10433654
  </code></pre>
  
  <p>The output file should look like this:</p>
  
  <pre><code>21:10433614:T:A 21  10433614    T   A   Biallelic_SNP   0.00075642965204236 0   0   0   0   0.000199680511182109
  21:10433619:T:A 21  10433619    T   A   Biallelic_SNP   0   0   0.00496031746031746 0   0   0.000998402555910543
  21:10433654:C:T 21  10433654    C   T   Biallelic_SNP   0   0   0   0.00397614314115308 0   0.000798722044728434
  </code></pre>
  
  <p>Here is the script i'm using:</p>
  
  <pre><code>paternFile = open('paterns.txt')
  newFile = open('newFile.txt', 'a')
  largeFile = open('largeFile.txt')
  for line in largeFile:
      string = line
      for row in paternFile:
          patern = row[:-1] #to remove the end of line character
          if re.search(patern, string):
              newFile.write(string)
  newFile.close()
  largeFile.close()
  paternFile.close()
  </code></pre>
  
  <p>I tested it in parts to check and apparently it should work, but it is not writing to my new file and I can't figure out why.
  [EDIT]
  As sugested I checked what my conditional is returning:</p>
  
  <pre><code>print(re.search(patern, string))
  NONE
  </code></pre>
  
  <p>I don't understand why it is returning NONE insted of TRUE or FALSE. Can anyone help?</p>