Finding a Way Around XLSREAD Not Working with OpenOffice

  • Context: MATLAB 
  • Thread starter Thread starter physicsCU
  • Start date Start date
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 19K views
physicsCU
Messages
198
Reaction score
1
so i guess xlsread won't work with openoffice. is there a way around this?

there has to be, xlsread is an editable file, but I need to know.

Thanks!
 
Physics news on Phys.org
physicsCU said:
so i guess xlsread won't work with openoffice. is there a way around this?

there has to be, xlsread is an editable file, but I need to know.

Thanks!


Use comma-separated-value files instead of xls files. xls format is a bad one to be working with IMO. Working with CSV files will make your life much easier, its a universal format (not much of a format even) that can easily be handled by any spreadsheet/data analysis program, and more importantly is easy to deal with in your own code.
 
OK, i can try that.

for what i am doing, it involves a lot of sheets of data, something on the order of 12 sheets. its a bit rough, but I have access to excel in a lab. i was hoping there was something i could change in the xlsread file.

i presume CSV files are loaded with the load command?
 
physicsCU said:
OK, i can try that.

for what i am doing, it involves a lot of sheets of data, something on the order of 12 sheets. its a bit rough, but I have access to excel in a lab. i was hoping there was something i could change in the xlsread file.

i presume CSV files are loaded with the load command?


csvread is the command. Its just a text file, with the values separated by commas.

The problem with using xls (well, there are several problems) is that its a nasty binary format, and if you use an xls made by open office it won't necessarily match the assumptions that the Matlab programmers made when they wrote the code for the xlsread function. CSV files are just simple text, separated by commas, they will always work, no matter what program saved them. it could have been notepad, excel, or open office, it won't matter.