Skip to content

Instantly share code, notes, and snippets.

@zhuochun zhuochun/rename.rb
Created Apr 28, 2014

Embed
What would you like to do?
Remove `%..` from files' filenames
files = Dir["*"].select { |filename| filename.include? "%" }
files.each do |filename|
new_name = filename.gsub(/%../, "")
File.rename(filename, new_name)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.