4.0

4.0 | 3 ratings Rate this file 32 downloads (last 30 days) File Size: 2.34 KB File ID: #18222

Load Open Document Spreadsheets

by Alex Marten

 

04 Jan 2008 (Updated 07 Jul 2009)

Code covered by the BSD License  

Loads a spreadsheet in the open document format (used by programs like Open Office) into a cell arra

Download Now | Watch this File

File Information
Description

The function provides a simple method with which one can load the contents of open document spreadsheets into MATLAB. Allowing users to directly import files created by Open Office into MATLAB.

Provided with the filename of the spreadsheet the function will import the contents into a MATLAB cell array. The function handles the presence of multiple worksheets by allowing the user to specify a particular worksheet to import.

The function has not undergone rigorous testing, but it has worked for all of my needs. Also, I think a similar method may be implemented to allow one to export data from MATLAB into open document spreadsheets.

MATLAB release MATLAB 7.4 (R2007a)
Zip File Content  
Other Files license.txt,
loadods.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
23 Jul 2008 Andrew Wagner

I too would love to have an ods exporter

21 Jan 2009 Steven

This is a great tool. I started writing one myself but found this instead. Thanks. Now for the writeods.m tool. Mathworks should put this into their standard toolbox soon.

20 Apr 2009 diego fonseca

I made an open office spread sheet, in ods file I made 2 sheets called sheet1 and sheet2, both have different numbers. When I write loadods('filename.ods','sheet1') it gives me a warning saying: MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details.
Also when I load the second sheet it only displays the first sheet. Is there a bug in the program or I am doing something wrong?

25 Jun 2009 diego fonseca  
30 Oct 2009 Ilya  
02 Feb 2010 Stefan

Thank for the tool. Now I don't have to use microsoft excel.
Seems to be working on matlab 6.5 R13, too. But there is an issue using filenames containing a complete path (like c:\myfiles\testfile.ods). The line 36 'if ~mkdir(tempdir,filename) fails and the result is 'permission error'. My solution: separating path and filename: loadods(filepath, filename, options).
There are some necessary changes in the lines 23, 26, 31 and 42. I'll try to upload my version (loadods_2010_02_02.m).

02 Feb 2010 Stefan

OK, submitting a new file was not a good idea. Here are my changed lines:

23 function data = loadods_2010_02_02(filepath,filename,options)

26 if nargin<3, options = []; end

31 if exist([filepath filename])~=2

42 unzip([filepath filename],dir_temp);

Note: the filename of the tool must be loadods_2010_02_02.m or change line 23

Please login to add a comment or rating.
Updates
07 Jul 2009

Updated for BSD licensing change

Tag Activity for this File
Tag Applied By Date/Time
data import Alex Marten 22 Oct 2008 09:42:02
data export Alex Marten 22 Oct 2008 09:42:02
open document spreadsheet Alex Marten 22 Oct 2008 09:42:02
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com