How to list only one line in log if it contains the same string on several lines?
<p>I have a .log file as a result from an <strong>sfv</strong> check.<br>
It contains mostly <code>OK</code>, but some <code>Failed</code> and some <code>Not Found</code>.</p>

<p>I have used</p>

<pre><code>findstr /v "OK" "sfv.Log" &gt; "Sfv.Replace.Log"
</code></pre>

<p>to only get the erroneous files/folders.</p>

<p>But it still leaves me with heaps of corrupt files in the same folders, so the log is still long.</p>

<p>Is there an easy way (batch) that I can only get one line per folder?</p>

<p>For example I would like for the log lines</p>

<pre><code>NOT FOUND    *****        CD8542\EN\contents\cnt\FSE14_15_07.swf
NOT FOUND    *****        CD8542\EN\contents\cnt\FSE19_05_01.flv
NOT FOUND    *****        CD8542\EN\contents\cnt\FSE19_05_02.flv
NOT FOUND    *****        CD8542\EN\contents\cnt\FSE19_06_01.flv
NOT FOUND    *****        CD8542\EN\contents\cnt\FSE19_06_05.flv
NOT FOUND    *****        CD8542\EN\contents\cnt\FSE19_06_06.flv
NOT FOUND    *****        CD8542\EN\contents\cnt\FSE19_08_02.flv
NOT FOUND    *****        CD8542\EN\contents\cnt\FSE19_08_03.flv
NOT FOUND    *****        CD8539\Course01\Lesson01\Exi_04\snd\NO.18.mp3
NOT FOUND    *****        CD8539\Course01\Lesson01\Exi_04\snd\NO.180.mp3
NOT FOUND    *****        CD8539\Course01\Lesson01\Exi_04\snd\NO.181.mp3
NOT FOUND    *****        CD8539\Course01\Lesson01\Exi_04\snd\NO.182.mp3
NOT FOUND    *****        CD8539\Course01\Lesson01\Exi_04\snd\NO.183.mp3
NOT FOUND    *****        CD8539\Course01\Lesson01\Exi_04\snd\NO.184.mp3
FAILED       CRC32        CD0165\Course01\Lesson01\alcap_4\5\q3.xml
FAILED       CRC32        CD0165\Course01\Lesson01\alcap_4\5\q4.xml
FAILED       CRC32        CD0165\Course01\Lesson01\alcap_4\5\q5.xml
FAILED       CRC32        CD0165\Course01\Lesson01\alcap_4\5\q6.xml
FAILED       CRC32        CD0165\Course01\Lesson01\alcap_4\5\q7.xml
FAILED       CRC32        CD0165\Course01\Lesson01\alcap_4\5\q8.xml
</code></pre>

<p>the output</p>

<pre><code>NOT FOUND    *****        CD8542\EN\contents\cnt\FSE14_15_07.swf
NOT FOUND    *****        CD8539\Course01\Lesson01\Exi_04\snd\NO.18.mp3
FAILED       CRC32        CD0165\Course01\Lesson01\alcap_4\5\q3.xml
</code></pre>

<p>This way I can more easily see what specific folders I can replace in a whole.</p>