title: How do I merge multiple text file content uniquely in Python?
body: <p>I have folder with many text files some of files has the same exact content to other. How can I merge just the unique content and ignore the duplicates?
  I do not remove duplicate lines. My files as the following:</p>
  
  <p>Text file1:</p>
  
  <pre><code>Line1
  Line1
  Line3
  </code></pre>
  
  <p>Text file2:</p>
  
  <pre><code>Line1
  Line1
  Line3
  </code></pre>
  
  <p>Text file3:</p>
  
  <pre><code>text1
  Line2
  text3
  </code></pre>
  
  <p>The result:</p>
  
  <pre><code>Line1
  Line1
  Line3
  text1
  Line2
  text3
  </code></pre>
  
  <p>I tried this but this only combine all of them into one file:</p>
  
  <pre><code>import glob
  txt_files = glob.glob('*.log')
  with open('merged_files.txt','w') as merged_files:
      for f in txt_files:
          for line in open(f,'r'):
              merged_files.write(line)
  </code></pre>
  
  <p>How can I read all the files and write only unique content in single text file?</p>