title: How to move duplicate lines from txt file and write to another?
body: <p>I'm trying to read a txt file, take all the duplicate lines of the unsorted text file and write them to another txt file. I'm a beginner to programming so take it easy on me.</p>
  
  <p>The code I have so far:</p>
  
  <pre><code>Options Explicit
  Const ForReading = 1
  Const ForWriting = 2
  
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objFile = objFSO.OpenTextFile("C:\Users\A352592\Desktop\list01.txt", ForReading)
  
  Set Dict = CreateObject("Scripting.Dictionary")
  Do until objInputFile.atEndOfStream
      strCurrentLine = objInputFile.ReadLine
      If not Dict.Exists(strCurrentLine) then 
          objOutputFile.WriteLine strCurrentLine
          Dict.Add strCurrentLine,strCurrentLine
      End if 
  Loop
  </code></pre>
  
  <p>Example of what the text file looks like:</p>
  
  <pre><code>(1) = "example 4"
  (1) = "example 6"
  (1) = "example 4"
  (1) = "example 2"
  </code></pre>
  
  <p>How would I remove the <code>(1) = "example 4"</code>line and write that to a new text file?</p>