I used a spreadsheet gem for this. It works, but can sometimes be very slow. I even tried Roo gem , but that did not improve performance. Is there a better way to do this job? The strange thing is that some worksheets in the same excel are faster, and some worksheets are very slow, even taking up to 1 hour.
Is it possible to use an open office to open each worksheet (tab) in one excel and convert them to csv much faster? If so, how do I do this in ruby?
Or is there an even better solution?
Just adding a small example that I tried with the Roo gem
xls = Roo::Excel.new(source_excel_file) xls.each_with_pagename do |name, sheet| # p sheet.to_csv(File.join(dest_csv_dir,name + ".csv")) #sheet.parse(:clean => true)#.to_csv(File.join(dest_csv_dir,name + ".csv")) puts name puts sheet.parse(:clean => true) end
ruby ruby-on-rails export-to-csv import-from-excel
Arunachalam
source share