Created
July 25, 2014 22:19
-
-
Save cdale77/d8502ef11373862f8eaa to your computer and use it in GitHub Desktop.
Recursively copy and rename files with Ruby
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 | |
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