-
-
Save harssh/3d70c2bcc944e6423d4a790c70316719 to your computer and use it in GitHub Desktop.
Recursively copy and rename files with Ruby
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
#!/usr/bin/env ruby | |
require 'fileutils' | |
files = Dir["*/*.PDF"].collect{|f| File.expand_path(f)} | |
files.each_with_index do |file, index| | |
puts "copying file #{index}" | |
FileUtils.cp file, "pdf/#{index}.pdf" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment