title: TCL-REGEX:: How to filter a line that appears multiple times in a text file using TCL regexp
body: <p>Input file (resultnew.txt):</p>
  
  <pre><code>www.maannews.net.
  
  www.maannews.net.
  
   ################################################# 
  
  attach2.mobile01.com.
  
  www.google-analytics.
  
  attach2.mobile01.com.
  
  attach2.mobile01.com.
  
  www.google-analytics.
  
  attach2.mobile01.com.
  
  attach2.mobile01.com.
  
  attach2.mobile01.com.
  
  attach2.mobile01.com.
  
  attach2.mobile01.com.
  
  www.google.com.
  
  attach2.mobile01.com.
  
  attach2.mobile01.com.
  
  attach2.mobile01.com.
  
   ################################################# 
  
  cdn-img.mocospace.com
  
  cdn-img.mocospace.com
  
  www.mocospace.com.
  
  cdn-img.mocospace.com
  
  cdn-img.mocospace.com
  
  cdn-img.mocospace.com
  
  www.mocospace.com.
  
  cdn-img.mocospace.com
  
  www.mocospace.com.
  
  www.google-analytics.
  
  www.google-analytics.
  
  fonts.gstatic.com.
  
  cdn-img.mocospace.com
  
  cdn-img.mocospace.com
  
  fonts.gstatic.com.
  
  fonts.gstatic.com.
  
   ################################################# 
  </code></pre>
  
  <p>My TCL Script:</p>
  
  <pre><code>set a [open resultnew.txt r]
  set b [open balu_output.txt w]
  
  
  while {[gets $a a1] &gt;=0} {
      if {[regexp {[a-zA-Z\.]} $a1]} {
      puts $b $a1
      }
  }
  </code></pre>
  
  <p>My Requirement:</p>
  
  <ol>
  <li>From the above text file, I want to remove the lines that appears multiple times and want to print only one time into a new file.</li>
  <li>Point 1 should happen between each "#################" and "#################". Still  "################# should appear in that text file".</li>
  </ol>
  
  <p>Please help me with your ideas. Thanks in advance.</p>
  
  <p>Thanks,</p>
  
  <p>Balu P.</p>