You have a number of small syntax/logical errors here, I think. First,
the "then" in this line should be removed:

>   if(minute =lastminute) then

as should the "if" at the very end:

>   end if

Also, you probably meant "minute == lastminute", not "=", which will
assign lastminute to minute (that's probably not what you want).

It should just be:

    if minute == last_minute
      # ...
    end

~ jf
--
John Feminella
Principal Consultant, BitsBuilder
LI: http://www.linkedin.com/in/johnxf
SO: http://stackoverflow.com/users/75170/



On Fri, Jun 10, 2011 at 21:25, Junkone <junkone1 / gmail.com> wrote:
> i get strange error test.rb.rb:14: syntax error, unexpected '}'
>
> makes no sense as the only time i use } is to close the each block. pl
> help
> require 'fastercsv'
> #put everything in an array
> array = FasterCSV.read("c:\\temp\\two.txt")
> seconds=0
> lastminute=0
> array.each{|row|
> minute=row[1].split(":")[1].to_i
> puts minute
> puts lastminute
>   if(minute =lastminute) then
>   puts "same as last minute"
>    seconds=seconds+1
>   end if
> }
>
>
>