From: botp Date: 2008-01-23T14:28:49+09:00 Subject: Re: How to improve this code? On Jan 23, 2008 9:05 AM, Jair Rillo Junior wrote: > My initial thought was store the values into a Hash object, where the my initial thought was just to output them plainly :) my stupid example follows, botp@pc4all:~$ cat test.rb v0=nil File.open("test.txt").each_line do |lines| values = lines.chomp.split(",") if v0 != values[0] puts unless v0.nil? v0 = values[0] print v0 end print ",",values[1] end botp@pc4all:~$ ruby test.rb bla@bla.com,value1,value2,value3,value4 ruby@ruby.br,value1,value2