title: Search for strings listed in one file from another text file?
body: <p>I want to find strings listed in list.txt (one string per line) in another text file in case I found it print 'string,one_sentence' in case didn't find 'string,another_sentence'. I'm using following code, but it is finding only last string in the strings list from file list.txt. Cannot understand what could be the reason?</p>
  
  <pre><code>data = open('c:/tmp/textfile.TXT').read()
  for x in open('c:/tmp/list.txt').readlines():
      if x in data:
          print(x,',one_sentence')
      else:
          print(x,',another_sentence')
  </code></pre>