I am getting unacceptable performace problems by using the roo gem for reading a file by using XLSX or XLS library from this gem. Someone may suggest me an alternative about how to parse an .XLSX file? <code> parsed_file = Excel.new(filename,false, :ignore) if (file_format.upcase == "XLS") parsed_file = Excelx.new(filename,false, :ignore) if (file_format.upcase == "XLSX") raise t "#{filename} is not an Excel file!" if (!parsed_file) parsed_file.default_sheet parsed_file.sheets[0]#''Sheet2''#oo.sheets[1] first_row = parsed_file.first_row last_row = parsed_file.last_row first_column = parsed_file.first_column last_column = parsed_file.last_column #logger.info "#### Total Rows:#{last_row}, first_row:#{first_row}, last_row:#{last_row}, first_column:#{first_column}, last_column:#{last_column}" first_row.upto(last_row) do |current_line| # Stuff .... end </code> Thanks -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
More details http://stackoverflow.com/questions/4875188/roo-gem-xlsx-files-performance-problems/4887273#4887273 On Feb 2, 2:02 pm, Alvaro Gonzalez <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I am getting unacceptable performace problems by using the roo gem for > reading a file by using XLSX or XLS library from this gem. > > Someone may suggest me an alternative about how to parse an .XLSX file? > > <code> > parsed_file = Excel.new(filename,false, :ignore) if (file_format.upcase > == "XLS") > parsed_file = Excelx.new(filename,false, :ignore) if > (file_format.upcase == "XLSX") > raise t "#{filename} is not an Excel file!" if (!parsed_file) > > parsed_file.default_sheet > parsed_file.sheets[0]#''Sheet2''#oo.sheets[1] > > first_row = parsed_file.first_row > last_row = parsed_file.last_row > first_column = parsed_file.first_column > last_column = parsed_file.last_column > #logger.info "#### Total Rows:#{last_row}, first_row:#{first_row}, > last_row:#{last_row}, first_column:#{first_column}, > last_column:#{last_column}" > > first_row.upto(last_row) do |current_line| > # Stuff .... > end > </code> > > Thanks > > -- > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Maybe Matching Threads
- [Bug 915] New: segfault in error case : expr_evaluate_payload not checking payload->payload.desc being null
- [Bug 1092] New: nft v0.6 segfault in must_print_eq_op at expression.c:520 during 'nft monitor trace' in netdev filter
- Malformed CSV Error
- getParseData() for installed packages
- [threadsafe] Arel ToSql visitor is not threadsafe