From: "baptiste AuguiƩ" Date: 2007-06-30T02:47:07+09:00 Subject: Re: newbie questions on processing numerical data from text files --Apple-Mail-10-821081139 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On 29 Jun 2007, at 14:32, Axel Etzold wrote: > Dear Baptiste, > > welcome to Ruby! Thanks a lot! I have a few problems though, > >> locate a line according to some keyword > > > interesting_text.delete_if{|line| /(r|R)uby/.match==nil} > > removes all lines that don't contain the string Ruby or ruby, for some reason this doesn't work for me. I get an error message: ArgumentError: wrong number of arguments (0 for 1) if i replace this argument with something based on line numbers rather than regexp, it's fine. Is the Regexp wrong? > >> and change a value > old_value=1.2 > new_value=2.4 > > interesting_text.sub!(old_value.to_s,new_value.to_s) > I can't get that to work either : NoMethodError: private method `sub!' called for # > > > Best regards, > > Axel The rest works fine, thanks again! baptiste --Apple-Mail-10-821081139--