Skip to content

Instantly share code, notes, and snippets.

@yas375
Created July 8, 2012 14:06
Show Gist options
  • Select an option

  • Save yas375/3071048 to your computer and use it in GitHub Desktop.

Select an option

Save yas375/3071048 to your computer and use it in GitHub Desktop.
script for image renaming
i = 0
Dir.new(".").each do |x|
if x != '.' && x != '..'
if File.extname(x) == '.JPG'
File.rename(x, "image#{i}.jpg")
i += 1
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment