forgot the new code :D

require 'rubygems'
require 'roo'



h = {}
oo=Excel.new("data.xls")

1.upto(29) do |line|
  a = oo.cell(line,'A')
  date = oo.cell(line,'B')
  b = date.to_s.gsub!('-','')
  h[a] = b
end

Dir['*.txt'].each do |file_name|
     replace = File.read(file_name)
            h.each do |template, date|
            replace.gsub!(template, date)
            end
            puts replace
File.makedirs("results")
File::open("results/#{file_name}","w") do |f|
    f<<replace
  end
end
-- 
Posted via http://www.ruby-forum.com/.