Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby copy file

my_dir = Dir["C:/Documents and Settings/user/Desktop/originalfiles/*.doc"]
my_dir.each do |filename|
  name = File.basename('filename', '.doc')[0,4]
  dest_folder = "C:/Documents and Settings/user/Desktop/destinationfolder/#{name}/"
  FileUtils.cp(filename, dest_folder)
end
Source by ruby-doc.org #
 
PREVIOUS NEXT
Tagged: #ruby #copy #file
ADD COMMENT
Topic
Name
4+2 =