From: cmzmasek@gmail.com Date: Thu, 23 Feb 2012 01:17:02 +0000 (+0000) Subject: silly script X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ed5c1330d2c949e1376d8ade1ead0e67014cb541;p=jalview.git silly script --- diff --git a/forester/ruby/scripts/do_something.rb b/forester/ruby/scripts/do_something.rb new file mode 100644 index 0000000..d50c1d1 --- /dev/null +++ b/forester/ruby/scripts/do_something.rb @@ -0,0 +1,23 @@ +require 'set' +require 'fileutils' + +set = Set.new + +File.open('infile', 'r') do |f| + while line = f.gets + set << line + end +end + +counter = 0 +set.each do |s| + puts s + s = s.chomp + '.prot' + if File.file?( s ) && File.size?( s ) + FileUtils.cp( s, "keep/" + s ) + counter += 1 + end +end + +puts "Copied " + counter.to_s + " files." +