From: Tim Hunter Date: 2007-05-02T07:05:05+09:00 Subject: Re: file & split Marcin Kulisz wrote: > Logan Capaldo wrote: > >>> but I still don't know how to put together all this numbers >>> >> I' m not sure what you mean by "put together all this numbers." A good >> thing to do when you are trying to write a program is to play with it >> irb. >> You get immediate feedback. >> > > I've got this few lines > while line=file.gets > tab=line.split > c8=tab[7].to_f > end > and it works. Results of is it's like that > 22121.12 > 4232.1 > 42353.90 > 322.0 > when I'll add line like this "puts sum=+c8" just before end nothing > happens, all I want is to add one number to another (evaluate it) > > Two things: a) It's "+=" not "=+" b) You probably need to convert c8 to a number before you can add it puts sum += c8.to_i -- RMagick [http://rmagick.rubyforge.org] RMagick Installation FAQ [http://rmagick.rubyforge.org/install-faq.html]