title: remove last characters string batch
body: <p>hello I need to generate list of images in a txt file, but I have to remove the last character and delete duplicates</p>
  
  <p>example </p>
  
  <pre><code>SDFDFDF_1.jpg
  SDFDFDF_2.jpg
  THGGHFG_1.jpg
  THGGHFG_2.jpg
  </code></pre>
  
  <p>and would have to stay that way in txt list</p>
  
  <pre><code>SDFDFDF
  THGGHFG
  </code></pre>
  
  <p>my code removes only .jpg</p>
  
  <pre><code>@echo off
  if exist "sku.txt" del "sku.txt"
  for /f "delims=" %%f in ('dir *.jpg /b') do echo %%~nf &gt;&gt; sku.txt
  </code></pre>