Skip to content

Instantly share code, notes, and snippets.

@zhuochun
Created April 28, 2014 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhuochun/11375815 to your computer and use it in GitHub Desktop.
Save zhuochun/11375815 to your computer and use it in GitHub Desktop.
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