title: Re-Post - Ruby on Rails Script to Rename Files
body: <p>I have reposted this because i have added to it </p>
  
  <p>I have a script that renames files from a .csv file, this file works fine but am looking to edit it a little bit more so that it help me even more.</p>
  
  <p>The scenario is I have 8,000 images that have a CID code some of them have the CID code some of them have extra text with it and are multiple images under the same CID ID i.e <code>17263.jpg</code> <code>17263a.jpg</code>, <code>17623b.jpg</code>, I then need to rename the CID images with product codes to work on a website, as well as adding the relevant <i>a</i> or <i>b</i> or <i>c</i> letter after it, if there are multiple images I have the files CID files in the left hand of the .csv column but i don't have a easy way of matching the two code up together because there are so many.</p>
  
  <p>I was wondering if there was a way of scripting ruby to search for the relevant cid code within the file name and rename it as the relevant product number?</p>
  
  <p>Here is a link to where i downloaded the Script, i have changed it so it works with new ruby</p>
  
  <p><a href="http://roguepenguin.net/PFID2SKU/" rel="nofollow">http://roguepenguin.net/PFID2SKU/</a></p>
  
  <p>Sorry for the mess up with the post earlier this week</p>
  
  <p>Hope you can understand.</p>
  
  <p>Thanks for the help.</p>