Skip to content

Instantly share code, notes, and snippets.

@felinebabies
Created December 23, 2015 05:15
Show Gist options
  • Select an option

  • Save felinebabies/09098fab5f69e635c554 to your computer and use it in GitHub Desktop.

Select an option

Save felinebabies/09098fab5f69e635c554 to your computer and use it in GitHub Desktop.
require 'rake'
files = FileList["**/*.png"]
files.each do |f|
headName = f[0..23]
footName = f[-4,4]
fileNumber = f[24..-5]
newName = headName + format("%04d", fileNumber) + footName
puts newName
FileUtils.mv(f, newName)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment