Created
August 25, 2015 09:12
-
-
Save tommorris/a617b158c014c868a71a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def change_filename fn | |
matcher = /Statement--(\d{6})-\d+--(\d{2})-(\d{2})-(\d{4})-(\d{2})-(\d{2})-(\d{4}).pdf/ | |
return fn.gsub(matcher, '\4-\3-\2 - \7-\6-\5.pdf') | |
end | |
`ls | grep Statement`.split("\n").each do |fn| | |
`mv "#{fn}" "#{change_filename(fn)}"` | |
end | |
# MIT licensed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment