title: Delete all files NOT containing a string & Rename files based on a pattern
body: <p>I have a directory that organizes files into other directories named after ID numbers.  Each of these directories contains icons as well as animation frames for graphical objects. I need to keep all files containing the string "icon"</p>
  
  <p>&nbsp;</p>
  
  <p>Here is an example of a directory:</p>
  
  <pre><code>0501
  |   05010000.effect.default.0.png
  |   05010000.effect.default.1.png
  |   05010000.effect.default.2.png
  |   05010000.effect.default.3.png
  |   05010000.effect.default.icon.png
  |   05010000.effect.default.iconRaw.png
  </code></pre>
  
  <p>&nbsp;</p>
  
  <p>Afterwards, the directory should look like:</p>
  
  <pre><code>0501
  |   05010000.effect.default.icon.png
  |   05010000.effect.default.iconRaw.png
  </code></pre>
  
  <p>&nbsp;</p>
  
  <p>What would be even better is if I could also rename items in the directory to:</p>
  
  <pre><code>0501
  |   5010000.png
  |   5010000raw.png
  </code></pre>
  
  <p>respecting the original ID number for each image and deleting the leading 0. </p>
  
  <p>&nbsp;</p>
  
  <p>This may not even be possible, but I have thousands of images that I need to do this for, so a manual process is not feasible.</p>