zdavatz / spreadsheet

The Ruby Spreadsheet by ywesee GmbH
http://spreadsheet.ch
GNU General Public License v3.0
1.13k stars 240 forks source link

Corrupt File #162

Closed yoshie902a closed 8 years ago

yoshie902a commented 8 years ago

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?

zdavatz commented 8 years ago

what software created the file in the first place? Please upload the file somewhere and link it here.

yoshie902a commented 8 years ago

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.

zdavatz commented 8 years ago

Ok, if the file is created by MS XLS for Mac, spreadsheet does not really work, cause the Mac XLS Version creates faulty files.