Skip to content

Instantly share code, notes, and snippets.

@zhuochun
Created April 28, 2014 15:41
Show Gist options
  • Select an option

  • Save zhuochun/11375815 to your computer and use it in GitHub Desktop.

Select an option

Save zhuochun/11375815 to your computer and use it in GitHub Desktop.

Revisions

  1. zhuochun created this gist Apr 28, 2014.
    5 changes: 5 additions & 0 deletions rename.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    files = Dir["*"].select { |filename| filename.include? "%" }
    files.each do |filename|
    new_name = filename.gsub(/%../, "")
    File.rename(filename, new_name)
    end