From: "Jesús Gabriel y Galán" Date: 2010-07-31T03:40:16+09:00 Subject: Re: my script just read one line? On Fri, Jul 30, 2010 at 4:00 PM, Junhui Liao wrote: > Dear Jesús Gabriel y Galán, > > It's quite strange. There is such a error message. > > To this line,   every_line.each_slice(2).with_index do |(time,signal), > index| . > > split_time_subtract.rb:5:in `write_line_to_file': undefined method > `each_slice' for # (NoMethodError) What I'm typing is untested, is just to give you some ideas. In any case, this error is because I meant the first_line variable to contain an array, but I misplaced the call to split: Replace this: >> first_line = file.readline >> first_line_times = first_line.chomp.split("\t").each_slice(2).map with this: first_line = file.readline.chomp.split("\t") first_line_times = first_line.each_slice(2).map Jesus.