From: "Ralf Müller" Date: 2005-05-04T22:10:10+09:00 Subject: Re: writing to a file with gsub! On Wed, 4 May 2005 22:03:30 +0900 Stefan Lang wrote: > # open file test for reading > open "test" do |src| > # open test.tmp for writing > open "test.tmp", "w" do |tmp| > # read line from test, substitute and write modified line to test.tmp > src.each { |line| tmp << line.gsub(/\d+/, '###') } > end > end > File.rename "test.tmp", "test" > > Stefan > das haut! Thanx !!! ralf