Created
October 22, 2011 11:59
-
-
Save arosh/1305914 to your computer and use it in GitHub Desktop.
Renamer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
files = Dir.glob("*.abc") # 拡張子で指定する | |
files.each do |f| | |
if f =~ /regex/ # 正規表現でガリガリ | |
puts "#{f} -> hogehoge - #{$1}.abc" # キャプチャーしたのも、てけとーに | |
#File.rename(f, "hogehoge - #{$1}.abc") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment