title: Batch script to delete duplicate lines but wanted to ignore/skip some lines
body: <p>Is it also possible to ignore some duplicate lines while removing other duplicates from an xml file, example: if my abx.xml is 
  CODE:</p>
  
  <pre><code>@echo off
  setlocal disableDelayedExpansion
  set "file=%~1"
  set "line=%file%.line"
  set "deduped=%file%.deduped"
  ::Define a variable containing a linefeed character
  set LF=^
  
  
  ::The 2 blank lines above are critical, do not remove
  &gt;"%deduped%" (
    for /f usebackq^ eol^=^%LF%%LF%^ delims^= %%A in ("%file%") do (
      set "ln=%%A"
      setlocal enableDelayedExpansion
      &gt;"%line%" (echo !ln:\=\\!)
      &gt;nul findstr /xlg:"%line%" "%deduped%" || (echo !ln!)
      endlocal
    )
  )
  &gt;nul move /y "%deduped%" "%file%"
  2&gt;nul del "%line%"
  </code></pre>
  
  <p>Only <strong>BATCH SCRIPT</strong> PLEASE.</p>
  
  <pre><code>&lt;bookstores&gt;
     &lt;book id="parent"&gt;
        &lt;name="it1"/&gt;
        &lt;name="it1"/&gt;
        &lt;name="it2"/&gt;
     &lt;/book&gt;
     &lt;book id="child"&gt;
        &lt;name="it1"/&gt;
        &lt;name="it1"/&gt;
        &lt;name="it2"/&gt;
        &lt;name="it3"/&gt;
     &lt;/book&gt;     
  &lt;/bookstores&gt;
  </code></pre>
  
  <p>Output should be:</p>
  
  <pre><code>&lt;bookstores&gt;
     &lt;book id="parent"&gt;
        &lt;name="it1"/&gt;
        &lt;name="it2"/&gt;
     &lt;/book&gt;
     &lt;book id="child"&gt;
        &lt;name="it3"/&gt;
     &lt;/book&gt;     
  &lt;/bookstores&gt;
  </code></pre>
  
  <p>But the output i am getting is:
  <strong>NOTE:</strong> <code>&lt;/book&gt;</code> tag is removed.</p>
  
  <pre><code>&lt;bookstores&gt;
     &lt;book id="parent"&gt;
        &lt;name="it1"/&gt;
        &lt;name="it2"/&gt;
     &lt;/book&gt;
     &lt;book id="child"&gt;
        &lt;name="it3"/&gt;
  
  &lt;/bookstores&gt;
  </code></pre>
  
  <p>I have searched couple of simillar requests but most of them are deleting all duplicate lines,but not sure how to ignore some duplicate lines:</p>
  
  <p><a href="https://stackoverflow.com/questions/11689689/batch-to-remove-duplicate-rows-from-text-file/17859683#17859683">Batch to remove duplicate rows from text file</a></p>