From: Johannes Held Date: 2011-05-20T16:40:31+09:00 Subject: Re: replace lines in a file using hash key-value pairs Something like that? hash = {"#HOST#" => "localhost", "#PORT#" => "2020" } fdata = File.read("config.ini") hash.each {|key, value| fdata.gsub(key, value) } File.open("config_new.ini", "w") { |f| f.write(fdata) } -- Johannes