I'm on Rails 5 (Ruby 2.4). I want to read a .xls document, and I would like to receive the data in CSV format, as in the Excel file. Someone recommended using Roo, and so I have
book = Roo::Spreadsheet.open(file_location)
sheet = book.sheet(0)
text = sheet.to_csv
arr_of_arrs = CSV.parse(text)
However, what is returned does not match what I see in the spreadsheet. For isntance, the cell in the spreadsheet has
16:45.81
and when I get the CSV data from above, it returns
"0.011641319444444444"
How to parse an Excel document and get exactly what I see? I don't care if I use Roo for parsing or not, as long as I can get the CSV data, which is a representation of what I see, and not some kind of weird internal representation. For reference, the file type I parsed givies when I run "file name_of_file.xls" ...
Composite Document File V2 Document, Little Endian, Os: Windows, Version 5.1, Code page: 1252, Author: Dwight Schroot, Last Saved By: Dwight Schroot, Name of Creating Application: Microsoft Excel, Create Time/Date: Tue Sep 21 17:05:21 2010, Last Saved Time/Date: Wed Oct 13 16:52:14 2010, Security: 0