Editing IO package
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 29: | Line 29: | ||
</nowiki></pre> | </nowiki></pre> | ||
==== xlswrite / odswrite versus xlsopen / odsopen ..... xlsclose / odsclose ==== | ==== xlswrite / odswrite versus xlsopen / odsopen ..... xlsclose / odsclose ==== | ||
Line 56: | Line 55: | ||
* .xls - is an outdated default binary file format from <= Office 2003 - '''try to avoid this format!''' | * .xls - is an outdated default binary file format from <= Office 2003 - '''try to avoid this format!''' | ||
* .xlsx - is the new default file format since Office 2007. [https://en.wikipedia.org/wiki/OOXML It consists of xml files stored in a .zip container.] - '''always save in or convert to this format!''' | * .xlsx - is the new default file format since Office 2007. [https://en.wikipedia.org/wiki/OOXML It consists of xml files stored in a .zip container.] - '''always save in or convert to this format!''' | ||
* The ''(new)'' OCT interface can read ''(since version 1.2.5)'' and write ''(since version 2.2.0)'' .xlsx files dependency-free! No need of MS Windows+Office nor Java | * The ''(new)'' OCT interface can read ''(since version 1.2.5)'' and write ''(since version 2.2.0)'' .xlsx files dependency-free! No need of MS Windows+Office nor Java. | ||
* Windows is notorious for hiding "known" file extensions. However in Windows Explorer it is easy to change this and have Windows show all file extensions. | * Windows is notorious for hiding "known" file extensions. However in Windows Explorer it is easy to change this and have Windows show all file extensions. | ||
==== different interfaces ==== | ==== different interfaces ==== | ||
Line 99: | Line 99: | ||
==== 32 vs. 64-bit issues ==== | ==== 32 vs. 64-bit issues ==== | ||
Generally, if you use a Java-based interface for spreadsheet I/O, it doesn't matter much whether you use Octave 32-bit or Octave 64-bit, | Generally, if you use a Java-based interface for spreadsheet I/O, it doesn't matter much whether you use Octave 32-bit or Octave 64-bit. | ||
However, the UNO interface (for LibreOffice & OpenOffice.org) is more pertinent: 64-bit Octave can only use a 64-bit LibreOffice with UNO, same for 32 bit. | |||
==== Java example ==== | ==== Java example ==== | ||
Line 134: | Line 133: | ||
</nowiki></pre> | </nowiki></pre> | ||
An easier way is to collect all required Java class libs | An easier way is to collect all required Java class libs fo spreadsheet I/O (the .jar files) in one subdir and have chk_spreadsheet_support .m sort it all out: | ||
<pre><nowiki> | <pre><nowiki> | ||
octave:8> chk_spreadsheet_support ('/full/path/to/subdir/with/.jar/files') | octave:8> chk_spreadsheet_support ('/full/path/to/subdir/with/.jar/files') | ||
Line 495: | Line 494: | ||
==== Spreadsheet formula support ==== | ==== Spreadsheet formula support ==== | ||
When using the | When using the COM, POI, JXL, and UNO interfaces you can: | ||
* (When reading, xls2oct) either read spreadsheet formula results, or the literal formula text strings (also works with OCT interface); | * (When reading, xls2oct) either read spreadsheet formula results, or the literal formula text strings (also works with OCT interface); | ||
* (When writing, oct2xls) either enter formulas in the worksheet as formulas, or enter them as literal text strings. | * (When writing, oct2xls) either enter formulas in the worksheet as formulas, or enter them as literal text strings. | ||
Line 507: | Line 506: | ||
Be aware that there's no formula evaluator in JExcelAPI (JXL) nor OpenXLS (OXS). So if you create formulas in your spreadsheet using oct2xls or xlswrite with 'JXL' or 'OXS', do not expect meaningful results when reading those files later on ,unless you open them in Excel and write them back to disk. | Be aware that there's no formula evaluator in JExcelAPI (JXL) nor OpenXLS (OXS). So if you create formulas in your spreadsheet using oct2xls or xlswrite with 'JXL' or 'OXS', do not expect meaningful results when reading those files later on ,unless you open them in Excel and write them back to disk. | ||
While both Apache POI and JExcelAPI feature a formula validator, not all spreadsheet functions present in Excel have been implemented (yet). | While both Apache POI and JExcelAPI feature a formula validator, not all spreadsheet functions present in Excel have been implemented (yet). | ||
Worse, older Excel versions feature less functions than newer versions. So be wary as this may make for interesting confusion | Worse, older Excel versions feature less functions than newer versions. So be wary as this may make for interesting confusion. | ||
==== Matlab compatibility ==== | ==== Matlab compatibility ==== | ||
Line 602: | Line 599: | ||
=== OCT interface === | === OCT interface === | ||
Since io package version 1.2.4, an interface called "OCT" was added. Except for unzip, it has no dependencies and it | Since io package version 1.2.4, an interface called "OCT" was added. Except for unzip, it has no dependencies. It's still experimental but fast! Feel free to test it and give us a feedback. | ||
Currently it supports reading and writing .xlsx, .ods and .gnumeric files (the latter in yet-to-be-released io-2.2.2). | |||
If | If | ||
<pre>chk_spreadsheet_support == 0</pre> | <pre>chk_spreadsheet_support == 0</pre> | ||
Line 610: | Line 608: | ||
<pre>m = xlsread ('file.xlsx', 1, [], 'OCT');</pre> | <pre>m = xlsread ('file.xlsx', 1, [], 'OCT');</pre> | ||
Since io package version 2.2.0, the "OCT" interface has experimental write support for .xlsx and .ods formats, since io-2.2.2 (expected mid-May 2014) also for gnumeric. If you can't wait for gnumeric I/O you can checkout a snapshot from svn (see octave.sf.net, http://sourceforge.net/p/octave/code/HEAD/tree/trunk/octave-forge/main/io/) | |||
[[Category:Octave Forge]] | [[Category:Octave Forge]] |