Closed yoshie902a closed 8 years ago
what software created the file in the first place? Please upload the file somewhere and link it here.
Issue resolved. I copied the content to another file, still did not work, so I copied just the relevant data I needed and it worked. Might have been an encoding issue, not sure. MS Excell 2011 Mac was the software.
Ok, if the file is created by MS XLS for Mac, spreadsheet does not really work, cause the Mac XLS Version creates faulty files.
I am running OS X 10.10.5 I have MS Excel 2011 Ruby 2.2.3 I ran
sudo gem install spreadsheet
and the following code from a ruby script, no rails. It's as simple as it can be.require 'spreadsheet' book = Spreadsheet.open('all_data.xls') sheet1 = book.worksheet('sheet1') sheet1.rows[0][1] = "TESTING" book.write('all_data_changed.xls')
Nonetheless, the file can not be opened and says it's corrupted. What am I missing?