title: Move file to new directory only if it contains specified string
body: <p>I have 1 folder with thousands of files and I need to loop through every single file and see if that file contains a specific string, once it has concluded that it has a specific string, it must then be moved to the correct folder. So far I have:</p>
  
  <pre><code>for filename in glob.iglob('*.txt'):
      f = open(filename)
      s = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
      if s.find('* Test Outcome : FAIL') != -1:
              src_file = os.path.join(dirSTART, filename)
              dst_file = os.path.join(dirFAIL, filename)
              shutil.move(src_file, dst_file + filename)
  </code></pre>
  
  <p>At the moment, it only moves the first file but I know for a fact there's more.
  Thanks</p>