Hi,
Need help! Keep getting an error as I am trying to run the code :
hash = { 'A' => [ 'v', 'x', 'y' , 'z' ] , 'B' => [ 'm', 'n' , 'o' ] } #
!> assigned but unused variable - hash
CSV.open ('/home/kirti/workspace/Ruby/a.csv',"w", :headers => true)
csv> # !> possibly useless use of a literal in void context
hash.each do |k, v|
csv[k]=v
end
end
# ~> -:2: syntax error, unexpected ',', expecting ')'
# ~> ...me/kirti/workspace/Ruby/a.csv',"w", :headers => true) |csv|
# ~> ... ^
# ~> -:2: syntax error, unexpected ',', expecting end-of-input
# ~> ...irti/workspace/Ruby/a.csv',"w", :headers => true) |csv|
# ~> ... ^
Could anyone help me, where I did such mistake?
···
--
Posted via http://www.ruby-forum.com/\.