I am having a problem in reading the columns from an xls file. Following is the code: workbook = Spreadsheet::ParseExcel.parse(params[:dump][:file]) worksheet = workbook.worksheet(0) skip=0 worksheet.each(skip) { |row| puts row.at(0) } I am storing "Customer" in the first row first column. When I print, it is received as C[]u[]s[]t[]o[]m[]e[]r[] (I mean a box in between each letter). Am i missing out anything in the code? Please help. Thanks in advance. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Vidya Ramachandren
2008-Aug-26 10:47 UTC
Re: problem in reading the columns from an xls file
row.at(0).to_s(''latin1'') has fixed the issue. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---