/usr/share/octave/packages/io-2.4.10/doc-cache is in octave-io 2.4.10-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 | # doc-cache created by Octave 4.2.2
# name: cache
# type: cell
# rows: 3
# columns: 36
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
append_save
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 799
append_save M-file function
Objective: be able to add variables to existing save files. Works for
all the types of save files that "save" supports.
Input:
1) A string which specifies the existing save file.
2) The options you need to pass to the 'save' function to save to the
file type that you want.
3) A 1x2 cell, with the first element being a string representation
of the variable/symbol that you're trying to add, followed by the
actual variable/symbol itself.
4) Any number of additional 1x2 cells, following the same format as
the 3rd argument specified immediately before this one.
Output:
Currently, none. But there might be some debugging / error-code
messages in the future.
Example:
octave> B = ones(2,2);
octave> append_save( "test.txt", "-binary", {"B", B } )
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
append_save M-file function
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
calccelladdress
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 239
calccelladdress (R, C) - compute spreadsheet style cell address from
row & column index (both 1-based).
Max column index currently set to 18278 (max ODS: 1024, OOXML: 16384).
Row limits for ODF and OOXML are 65536 and 1048576, resp.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
calccelladdress (R, C) - compute spreadsheet style cell address from
row & col
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
chk_spreadsheet_support
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5106
-- Function File: [ RETVAL, INTFS, LJARS ] = chk_spreadsheet_support ()
-- Function File: [ RETVAL, INTFS, LJARS ] = chk_spreadsheet_support (
PATH_TO_JARS )
-- Function File: [ RETVAL, INTFS, LJARS ] = chk_spreadsheet_support (
PATH_TO_JARS, DEBUG_LEVEL )
-- Function File: [ RETVAL, INTFS, LJARS ] = chk_spreadsheet_support (
PATH_TO_JARS, DEBUG_LEVEL, PATH_TO_OOO )
Check Octave environment for spreadsheet I/O support, report any
problems, and optionally add or remove Java class libs for
spreadsheet support.
chk_spreadsheet_support first checks ActiveX (native MS-Excel);
then Java JRE presence, then Java support (if builtin); then checks
existing javaclasspath for Java class libraries (.jar files) needed
for various Java-based spreadsheet I/O interfaces. If requested
chk_spreadsheet_support will try to add the relevant Java class
libs to the dynamic javaclasspath. chk_spreadsheet_support
remembers which Java class libs it has added to the javaclasspath;
optionally it can unload them as well.
PATH_TO_JARS - relative or absolute path name to subdirectory
containing these classes. TAKE NOTICE: /forward/ slashes are
needed! chk_spreadsheet_support() will recurse into at most two
subdir levels; if the Java class libs are scattered across deeper
subdir levels or further apart in the file system, multiple calls
to chk_spreadsheet_support may be required. PATH_TO_JARS can be []
or " if no class libs need to be added to the javaclasspath.
PATH_TO_OOO - installation directory of OpenOffice.org (again with
/forward/ slashes). Usually that is something like (but no
guarantees):
- Windows: C:/Program Files/OpenOffice.org or C:/Program Files
(X86)/LibreOffice
- *nix: /usr/lib/ooo or /opt/libreoffice
- Mac OSX: ?????
IMPORTANT: PATH_TO_OOO should be such that both:
1. PATH_TO_OOO/program/
and
2. PATH_TO_OOO/ure/.../ridl.jar
resolve OK.
(Note that LibreOffice/OOo should match the bit width (32bit or
64bit) of the Java version Octave was built with.)
DEBUG_LEVEL: (integer) between [0 (no output) .. 3 (full output]
0
No debug output is generated.
1
Only proper operation of main interface groups (COM, Java) is
shown. If PATH_TO_JARS and/or PATH_TO_OOO was supplied,
chk_spreadsheet_support indicates whether it could find the
required Java class libs for all interfaces
2
Like 1, proper working of individual implemented Java-based
interfaces is shown as well. If PATH_TO_JARS and/or
PATH_TO_OOO was supplied, chk_spreadsheet_support indicates
for each individual Java-based interface whether it could add
the required Java class libs.
3
Like 2, also presence of individual javaclass libs in
javaclasspath is indicated. If PATH_TO_JARS and/or
PATH_TO_OOO was supplied, chk_spreadsheet_support reports for
each individual Java-based interface which required Java class
libs it could find and add to the javaclasspath.
-1 (or any negative number)
Remove all directories and Java class libs that
chk_spreadsheet_support added to the javaclasspath. If
DEBUG_LEVEL < 1 report number of removed javclasspath entries;
if DEBUG_LEVEL < 2 report each individual removed entry.
Output: RETVAL = 0: only spreadsheet support for OOXML & ODS 1.2
and read support for gnumeric present through OCT interface, or
RETVAL <> 0: At least one read/write spreadsheet I/O interface
found based on external software. RETVAL will be set to the sum of
values for found interfaces:
0 = OCT (Native Octave)
(read/write support for .xlsx, .ods and .gnumeric)
----------- XLS (Excel) interfaces: ----------
1 = COM (ActiveX / Excel) (any file format supported by MS-Excel)
2 = POI (Java / Apache POI) (Excel 97-2003 = BIFF8)
4 = POI+OOXML (Java / Apache POI) (Excel 2007-2010 = OOXML)
8 = JXL (Java / JExcelAPI) (Excel 95-read and Excel-97-2003-r/w)
16 = OXS (Java / OpenXLS) (Excel 97-2003)
---- ODS (OpenOffice.org Calc) interfaces ----
32 = OTK (Java/ ODF Toolkit) (ODS 1.2)
64 = JOD (Java / jOpenDocument) (.sxc (old OOo)-read, ODS 1.2)
------------------ XLS & ODS: ----------------
0 = OOXML / ODS read/write-, gnumeric read support (built-in)
128 = UNO (Java/UNO bridge - LibreOffice / OOs) (any format
supported by LibreOffice/OOo)
INTFS: listing of supported spreadsheet interfaces. The OCT
interface is always supported.
LJARS: listing of full paths of Java class libs and directories
that chk_spreadsheet_support has added to the javaclasspath.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Check Octave environment for spreadsheet I/O support, report any
problems, and o
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
dbfread
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3593
-- Function File: [DATA, DATINFO] = dbfread (FNAME)
-- Function File: [DATA, DATINFO] = dbfread (FNAME, RECS)
-- Function File: [DATA, DATINFO] = dbfread (FNAME, RECS, COLS)
-- Function File: [DATA, DATINFO] = dbfread (FNAME, RECS, COLS, RE)
Read contents of a dbase (dbf) file, provisionally dbase III+, IV
or V.
* FNAME should be the name of a valid dbase file; the file
extension isn't required.
* RECS can be an integer or logical array containing record
numbers or record indicators for those records that need to be
returned. If omitted, all records are read. Indices supplied
in RECS can be specified in any order, but the returned data
are sorted in order of records in the file.
* COLS can be a logical, integer, cellstr or character array
indicating from which file columns the data should be
returned. If a numeric array is supplied, it is considered to
be like a logical array if the maximum entry value equals 1.
Character arrays should have column names stacked in the
vertical (first) dimension. COLS cellstr or char arrays can
be supplied in any order, yet the returned data column order
matches that of the columns order in the dbase file. For
dbase files containing multiple columns with the same name,
specify a numeric or logical array to select columns to be
returned. If omitted, data from all file columns are
returned.
* If a value of 1 or true is entered for RE, dbfread also tries
to return data from erased records. No guarantee can be given
for these data to be correct or consistent! If omitted,
erased records are skipped.
* Return value DATA is a N+1 x M cellstr array where the
uppermost row contains the column names and the rest of the
rows the record data.
* Optional return argument DATINFO is a struct array containing
various information of the dbase file and record build-up.
Arguments RECS and COLS need not be as long as the number of
records and columns in the file, resp.; dbfread will stop reading
data if any of RECS or COLS (if supplied) is exhausted.
Sometimes dbase files contain records indicated as being erased.
The data in such records is silently skipped, unless the RE flag is
set and/or RECS is supplied and erased records happen to be present
in the requested record numbers.
Examples:
A = dbfread ("file.dbf");
(returns all data in file.dbf in array A)
[A, B] = dbfread ("file.dbf", [], ["colB"; "colF"]);
(returns all data in columns named "colB" and "colF" from
file.dbf in array A and information on the database
build-up in struct B)
A = dbfread ("file.dbf", [0 1 0 0 1 0 0]);
-or-
A = dbfread ("file.dbf", [2 5]);
(returns data from record numbers 2 and 5 in
file.dbf in array A)
A = dbfread ("file", [0 1 0 0 1 0]);
(returns data from record numbers 2 and 5 in
file.dbf in array A)
[~, B] = dbfread ("file.dbf", 0);
(to returns info on column names and number of
records, plus more info)
[A] = dbfread ("file", [], {"Header1", "Col5"});
(returns data from columns with names (headers)
Header1 and Col5, resp.)
See also: xlsread.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 71
Read contents of a dbase (dbf) file, provisionally dbase III+, IV or V.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
dbfwrite
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 758
-- Function File: [STATUS] = dbfwrite (FNAME, DATA)
Write data in a cell array to a dbf (xBase) file, provisionally
dBase III+.
FNAME must be a valid file name, optionally with '.dbf' suffix.
DATA should be a cell array of which the top row contains column
names (character strings). Each column must contain only one class
of data, except of course the top entry (the column header). Value
type that can be written are character (text sring), numeric
(integer and float, the latter with 6 decimal places), and logical.
Ouput argument STATUS is 1 if the file was written successfully, 0
otherwise.
Provisionally only dBase v. III+ files can be written without
memos.
See also: dbfread.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 75
Write data in a cell array to a dbf (xBase) file, provisionally dBase
III+.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
fexist
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 676
-- Function File: ex = fexist (file, tspec, aspec)
Checks whether a file exists. FILE is the queried file path.
TSPEC is a combination of letters f,d,p,S, corresponding to file
types:
* f: regular file
* d: directory
* p: named pipe (FIFO special file)
* S: socket
The query is true if the actual file type matches any of the
specified options.
ASPEC is a combination of letters r,w,x, corresponding to queried
access privileges to the file. The query is true if the current
user has all the spefied types of access, either through "user",
"group" or "other" specs.
See also: stat, lstat.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Checks whether a file exists.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
getxmlattv
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 196
-- Function File: [RETVAL] = getxmlattv (XMLNODE, ATT)
Get value of attribute ATT in xml node (char string) XMLNODE,
return empty if attribute isn't present.
See also: getxmlnode.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Get value of attribute ATT in xml node (char string) XMLNODE, return
empty if at
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
getxmlnode
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 499
-- Function File: [ NODE, S, E ] = getxmlnode (XML, TAG)
-- Function File: [ NODE, S, E ] = getxmlnode (XML, TAG, IS)
-- Function File: [ NODE, S, E ] = getxmlnode (XML, TAG, IS, CONTNT)
Get a string representing the first xml TAG node starting at
position IS in xml text string XML, and return start and end
indices. If IS is omitted it defaults to 1 (start of XML). If
CONTNT is TRUE, return the portion of the node between the outer
tags.
See also: getxmlattv.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Get a string representing the first xml TAG node starting at position IS
in xml
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
io_ods_testscript
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1198
-- Function File: io_ods_testscript (INTF1)
-- Function File: io_ods_testscript (INTF1, FNAME)
-- Function File: io_ods_testscript (INTF1, FNAME, INTF2)
Try to check proper operation of ODS spreadsheet scripts using
interface INTF1.
INTF1 can be one of OTK, JOD, UNO, or OCT. No checks are made as to
whether the requested interface is supported at all. If FNAME is
supplied, that filename is used for the tests, otherwise filename
"io-test.ods" is chosen by default. This parameter is required to
have e.g., JOD distinguish between testing (reading) .ods (ODS 1.2)
and .sxc (old OpenOffice.org & StarOffice) files (that UNO can
write).
If INTF2 is supplied, that interface will be used for writing the
spreadsheet file and INTF1 will be used for reading. The OCT
interface doesn't have write support (yet), so it will read
spreadsheet files made by OTK (if supported) unless another
interface is supplied for INTF2.
As the tests are meant to be run interactively, no output arguments
are returned. The results of all test steps are printed on the
terminal.
See also: test_spsh, io_xls_testscript.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 79
Try to check proper operation of ODS spreadsheet scripts using interface
INTF1.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
io_xls_testscript
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1152
-- Function File: io_xls_testscript (INTF1)
-- Function File: io_xls_testscript (INTF1, FNAME)
-- Function File: io_xls_testscript (INTF1, FNAME, INTF2)
Try to check proper operation of XLS / XLSX spreadsheet scripts
using interface INTF1.
INTF1 can be one of COM, POI, JXL, OXS, UNO, or OCT. No checks are
made as to whether the requested interface is supported at all. If
FNAME is supplied, that filename is used for the tests, otherwise
filename "io-test.xls" is chosen by default. This parameter is
required to have e.g., POI distinguish between testing .xls (BIFF8)
and .xlsx (OOXML) files.
If INTF2 is supplied, that interface will be used for writing the
spreadsheet file and INTF1 will be used for reading. The OCT
interface doesn't have write support (yet), so it will read
spreadsheet files made by POI (if supported) unless another
interface is supplied for INTF2.
As the tests are meant to be run interactively, no output arguments
are returned. The results of all test steps are printed on the
terminal.
See also: test_spsh, io_ods_testscript.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Try to check proper operation of XLS / XLSX spreadsheet scripts using
interface
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
object2json
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1582
Returns a valid json string that will describe object; the string will
be in a compact form (no spaces or line breaks).
It will map simple octave values this way:
function handles: string with the name of the function
double (numbers): depends:
If it's real it will map to a string representing that number
If it's complex it will map to an object with the next properties:
real: real part of the number
imag: imaginary part of the number
char: A string enclosed by double quotes representing that character
logical: text sring "true" or "false" (w/o double quotes)
And will map more complex octave values this other way:
struct: an object with properties equal to the struct's field names
and value equal to the json counterpart of that field
cell: it will be mapped depending on the value of the cell (for
example {i} will be mapped to an object with real=0 and imag=1)
vectors or cell arrays: it will map them to a corresponding js
array (same size) with the values transformed to their json
counterpart (Note: that in javascript all arrays are like octave's
cells ,i.e. they can store different type and size variables)
strings or char vectors: they will be mapped to the same string
enclosed by double quotes
Other octave values will be mapped to a string enclosed by double
quotes with the value that the class() function returns
It can handle escape sequences and special chars automatically.
If they're valid in JSON it will keep them if not they'll be
escaped so they can become valid
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Returns a valid json string that will describe object; the string will
be in a
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
oct2ods
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3725
-- Function File: [ ODS, RSTATUS ] = oct2ods (ARR, ODS)
-- Function File: [ ODS, RSTATUS ] = oct2ods (ARR, ODS, WSH)
-- Function File: [ ODS, RSTATUS ] = oct2ods (ARR, ODS, WSH, RANGE)
-- Function File: [ ODS, RSTATUS ] = oct2ods (ARR, ODS, WSH, RANGE,
OPTIONS)
Transfer data to an OpenOffice_org Calc (or gnumeric) spreadsheet
previously opened by odsopen().
Data in 1D/2D array ARR are transferred into a cell range RANGE in
sheet WSH. ODS must have been made earlier by odsopen(). Return
argument ODS should be the same as supplied argument ODS and is
updated by oct2ods. A subsequent call to odsclose is needed to
write the updated spreadsheet to disk (and -if needed- close the
Java invocation holding the file pointer).
ARR can be any 1D or 2D array containing numerical or character
data (cellstr) except complex. Mixed numeric/text arrays can only
be cell arrays.
ODS must be a valid pointer struct created earlier by odsopen.
WSH can be a number (sheet name) or string (sheet number). In case
of a yet non-existing Calc file, the first sheet will be used &
named according to WSH. In case of existing files, some checks are
made for existing sheet names or numbers. When new sheets are to
be added to the Calc file, they are inserted to the right of all
existing sheets. The pointer to the "active" sheet (shown when
Calc opens the file) remains untouched.
If RANGE is omitted, the top left cell where the data will be put
is supposed to be 'A1'; only a top left cell address can be
specified as well. In these cases the actual range to be used is
determined by the size of ARR. If defined in the spreadsheet file,
a "Named range" can also be specified. In that case WSH will be
ignored and the worksheet associated with the specified Named range
will be used. Be aware that large data array sizes may exhaust the
java shared memory space. For larger arrays, appropriate memory
settings are needed in the file java.opts; then the maximum array
size for the java-based spreadsheet options can be in the order of
perhaps 10^6 elements.
Optional argument OPTIONS, a structure, can be used to specify
various write modes.
"formulas_as_text"
If set to 1 or TRUE formula strings ( i.e., text strings
(assumed to start with "=" and end in a ")" ) are to be
written as litteral text strings rather than as spreadsheet
formulas (the latter is the default). As jOpenDocument
doesn't support formula I/O at all yet, this option is ignored
for the JOD interface.
'convert_utf'
If set to 1 or TRUE, oct2ods converts one-byte characters
outside the range [32:127] to UTF-8 so that they are properly
entered as UTF-8 encoded text in spreadsheets. The default
value is 0.
Data are added to the sheet, ignoring other data already present;
existing data in the range to be used will be overwritten.
If RANGE contains merged cells, also the elements of ARR not
corresponding to the top or left Calc cells of those merged cells
will be written, however they won't be shown until in Calc the
merge is undone.
Examples:
[ods, status] = oct2ods (arr, ods, 'Newsheet1', 'AA31:GH165');
Write array arr into sheet Newsheet1 with upperleft cell at AA31
[ods, status] = oct2ods ({'String'}, ods, 'Oldsheet3', 'B15:B15');
Put a character string into cell B15 in sheet Oldsheet3
See also: ods2oct, odsopen, odsclose, odsread, odswrite, odsfinfo.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Transfer data to an OpenOffice_org Calc (or gnumeric) spreadsheet
previously ope
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
oct2xls
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3897
-- Function File: [ XLS, RSTATUS ] = oct2xls (ARR, XLS)
-- Function File: [ XLS, RSTATUS ] = oct2xls (ARR, XLS, WSH)
-- Function File: [ XLS, RSTATUS ] = oct2xls (ARR, XLS, WSH, RANGE)
-- Function File: [ XLS, RSTATUS ] = oct2xls (ARR, XLS, WSH, RANGE,
OPTIONS)
Add data in 1D/2D CELL array ARR into a cell range RANGE in
worksheet WSH in an Excel (or gnumeric) spreadsheet file pointed to
in structure XLS. Return argument XLS equals supplied argument XLS
and is updated by oct2xls.
A subsequent call to xlsclose is needed to write the updated
spreadsheet to disk (and -if needed- close the Excel or Java
invocation).
ARR can be any 1D or 2D array containing numerical, logical and/or
character data (cellstr) except complex. Mixed type arrays can
only be cell arrays.
XLS must be a valid pointer struct created earlier by xlsopen.
WSH can be a number or string (max. 31 chars). In case of a yet
non-existing Excel file, the first worksheet will be used & named
according to WSH - extra empty worksheets that Excel creates by
default are deleted. In case of existing files, some checks are
made for existing worksheet names or numbers, or whether WSH refers
to an existing sheet with a type other than worksheet (e.g.,
chart). When new worksheets are to be added to the Excel file,
they are inserted to the right of all existing worksheets. The
pointer to the "active" sheet (shown when Excel opens the file)
remains untouched.
If RANGE is omitted or just the top left cell of the range is
specified, the actual range to be used is determined by the size of
ARR. If nothing is specified for RANGE the top left cell is
assumed to be 'A1'. If defined in the spreadsheet file, a "Named
range" can also be specified. In that case WSH will be ignored and
the worksheet associated with the specified Named range will be
used.
Data are added to the worksheet, ignoring other data already
present; existing data in the range to be used will be overwritten.
If RANGE contains merged cells, only the elements of ARR
corresponding to the top or left Excel cells of those merged cells
will be written, other array cells corresponding to that cell will
be ignored.
Optional argument OPTIONS, a structure, can be used to specify
various write modes.
"formulas_as_text"
If set to 1 or TRUE formula strings ( i.e., text strings
(assumed to start with "=" and end in a ")" ) are to be
written as litteral text strings rather than as spreadsheet
formulas (the latter is the default).
'convert_utf'
If set to 1 or TRUE, oct2xls converts one-byte characters
outside the range [32:127] to UTF-8 so that they are properly
entered as UTF-8 encoded text in spreadsheets. The default
value is 0. This setting has no effect for the COM interface
as that does the encoding automatically using libraries
outside Octave.
Beware that -if invoked- Excel invocations may be left running
silently in case of COM errors. Invoke xlsclose with proper
pointer struct to close them. When using Java, note that large
data array sizes elements may exhaust the Java shared memory space
for the default java memory settings. For larger arrays,
appropriate memory settings are needed in the file java.opts; then
the maximum array size for the Java-based spreadsheet options may
be in the order of 10^6 elements. In caso of UNO this limit is not
applicable and spreadsheets may be much larger.
Examples:
[xlso, status] = oct2xls ('arr', xlsi, 'Third_sheet', 'AA31:AB278');
See also: xls2oct, xlsopen, xlsclose, xlsread, xlswrite, xlsfinfo.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Add data in 1D/2D CELL array ARR into a cell range RANGE in worksheet
WSH in an
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
ods2oct
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4263
-- Function File: [ RAWARR, ODS, RSTATUS ] = ods2oct (ODS)
-- Function File: [ RAWARR, ODS, RSTATUS ] = ods2oct (ODS, WSH)
-- Function File: [ RAWARR, ODS, RSTATUS ] = ods2oct (ODS, WSH, RANGE)
-- Function File: [ RAWARR, ODS, RSTATUS ] = ods2oct (ODS, WSH, RANGE,
OPTIONS)
Read data contained within cell range RANGE from worksheet WSH in
an OpenOffice_org Calc or Gnumeric spreadsheet file pointed to in
struct ODS.
ODS is supposed to have been created earlier by odsopen() in the
same octave session.
WSH is either numerical or text, in the latter case it is
case-sensitive. Note that in case of a numerical WSH this number
refers to the position in the worksheet stack, counted from the
left in a Calc window. The default is numerical 1, i.e. the
leftmost worksheet in the ODS or gnumeric file.
RANGE is expected to be a regular spreadsheet range format, ""
(empty string, indicating all data in a worksheet), or a "Named
range" defined in the spreadsheet file. In case of a Named range,
the worksheet associated with that Named range will be used instead
of the one specified in WSH. If no range is specified the occupied
cell range will have to be determined behind the scenes first; this
can take some time.
Optional argument OPTIONS, a structure, can be used to specify
various read modes by setting option fields in the struct to true
(1) or false (0). Currently recognized option fields are:
"formulas_as_text"
If set to TRUE or 1, spreadsheet formulas (if at all present)
are read as formula strings rather than the evaluated formula
result values. This only works for the OTK, UNO and OCT
interfaces. The default value is 0 (FALSE).
'strip_array'
Set the value of this field set to TRUE or 1 to strip the
returned output array RAWARR from empty outer columns and
rows. The spreadsheet cell rectangle limits from where the
data actually came will be updated. The default value is
FALSE or 0 (no cropping).
'convert_utf'
If set to 1 or TRUE, ods2oct tries to do a best job of
converting UTF-8 characters to one-byte characters so that
they display properly in Octave if that uses a terminal that
does not support UTF-8 encoding (e.g., Windows 7 and below).
If only the first argument ODS is specified, ods2oct will try to
read all contents from the first = leftmost (or the only) worksheet
(as if a range of '' (empty string) was specified).
If only two arguments are specified, ods2oct assumes the second
argument to be WSH. In that case ods2oct will try to read all data
contained in that worksheet.
Return argument RAWARR contains the raw spreadsheet cell data. Use
parsecell() to separate numeric and text values from RAWARR.
Optional return argument ODS contains the pointer struct. Field
ODS.limits contains the outermost column and row numbers of the
actually read cell range.
Optional return argument RSTATUS will be set to 1 if the requested
data have been read successfully, 0 otherwise.
Erroneous data and empty cells turn up empty in RAWARR. Date/time
values in OpenOffice.org or Gnumeric are returned as numerical
values with base 1-1-0000 (same as octave). But beware that Excel
spreadsheets rewritten by OpenOffice.org into .ods format may have
numerical date cells with epoch (base) 01-01-1900 (same as
MS-Excel).
When reading from merged cells, all array elements NOT
corresponding to the leftmost or upper OpenOffice.org Calc or
Gnumeric cell will be treated as if the "corresponding" cells are
empty.
Examples:
A = ods2oct (ods1, '2nd_sheet', 'C3:ABS40000');
(which returns the numeric contents in range C3:ABS40000 in worksheet
'2nd_sheet' from a spreadsheet file pointed to in pointer struct ods1,
into numeric array A)
[An, ods2, status] = ods2oct (ods2, 'Third_sheet');
See also: odsopen, odsclose, parsecell, odsread, odsfinfo, oct2ods,
odswrite.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Read data contained within cell range RANGE from worksheet WSH in an
OpenOffice_
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
odsclose
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1135
-- Function File: [ODS] = odsclose (ODS)
-- Function File: [ODS] = odsclose (ODS, FILENAME)
-- Function File: [ODS] = odsclose (ODS, "FORCE")
Close the OpenOffice_org Calc / Gnumeric spreadsheet pointed to in
struct ODS, if needed write the file to disk.
odsclose will determine if the file must be written to disk based
on information contained in ODS. An empty pointer struct will be
returned if no errors occurred. Optional argument FILENAME can be
used to write changed spreadsheet files to an other file than
opened by odsopen(). Optional string argument "FORCE" can be
specified to force resetting the file pointer struct. However, in
case of UNO, a hidden OOo invocation may linger on in memory then,
preventing proper closing of Octave.
ODS must be a valid pointer struct made by odsopen() in the same
octave session.
Examples:
ods1 = odsclose (ods1);
(Close spreadsheet file pointed to in pointer struct ods1; ods1 is reset)
See also: odsopen, odsread, odswrite, ods2oct, oct2ods, odsfinfo,
chk_spreadsheet_support.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Close the OpenOffice_org Calc / Gnumeric spreadsheet pointed to in
struct ODS, i
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
odsfinfo
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2453
-- Function File: [FILETYPE] = odsfinfo (FILENAME [, REQINTF])
-- Function File: [FILETYPE, SH_NAMES] = odsfinfo (FILENAME [,
REQINTF])
-- Function File: [FILETYPE, SH_NAMES, NMRANGES] = odsfinfo (FILENAME
[, REQINTF])
-- Function File: [FILETYPE, SH_NAMES, FFORMAT, NMRANGES] = odsfinfo
(FILENAME [, REQINTF])
Query an OpenOffice_org or Gnumeric spreadsheet file FILENAME (with
ods or gnumeric suffix) for some info about its contents.
If FILENAME is a recognizable OpenOffice.org or Gnumeric
spreadsheet file, FILETYPE returns the string "OpenOffice.org Calc
spreadsheet" (or "Gnumeric spreadsheet"), or '' (empty string)
otherwise.
If FILENAME is a recognizable OpenOffice.org Calc or Gnumeric
spreadsheet file, optional argument SH_NAMES contains a Nx2 list
(cell array) of sheet names contained in FILENAME and total used
data ranges for each sheet, in the order (from left to right) in
which they occur in the sheet stack.
Optional output argument FFORMAT is a string describing the file
contents.
Optional return argument NMRANGES returns a list of Named ranges
defined in the spreadsheet, if any.
If you omit return arguments FILETYPE and SH_NAMES altogether,
odsfinfo returns the sheet names and for each sheet the actual
occupied data ranges to the screen. The occupied cell range will
have to be determined behind the scenes first; this can take some
time. If any Named ranges are defined in the spreadsheet file,
they will be listed on the screen as well. Named ranges work only
for the OCT interface, with the UNO interface it doesn't work for
.ods files.
odsfinfo execution can take its time for large spreadsheets as the
entire spreadsheet has to be parsed to get the sheet names, let
alone exploring used data ranges.
By specifying a value of 'jod', 'otk', 'uno' or 'oct' for REQINTF
the automatic selection of the Java interface is bypassed and the
specified interface will be used (if at all present).
Examples:
exist = odsfinfo ('test4.ods');
(Just checks if file test4.ods is a readable Calc file)
[exist, names] = odsfinfo ('test4.ods');
(Checks if file test4.ods is a readable Calc file and return a
list of sheet names)
See also: odsread, odsopen, ods2oct, odsclose.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Query an OpenOffice_org or Gnumeric spreadsheet file FILENAME (with ods
or gnume
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
odsopen
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3211
-- Function File: ODS = odsopen (FILENAME)
-- Function File: ODS = odsopen (FILENAME, READWRITE)
-- Function File: ODS = odsopen (FILENAME, READWRITE, REQINTF)
Get a pointer to an OpenOffice_org spreadsheet in the form of
return argument ODS.
Calling odsopen without specifying a return argument is fairly
useless!
Octave links to external software for read/write support of
spreadsheets; these links are "interfaces". For I/O from/to ODS
1.2 and Gnumeric XML, in principle no external SW is required, this
"interface" is called 'OCT'. For more flexibility and better
performance, you need a Java JRE or JDK plus one or more of
(ODFtoolkit (version 0.7.5 or 0.8.6 - 0.8.8) & xercesImpl v.2.9.1),
jOpenDocument, or OpenOffice.org (or clones) installed on your
computer + proper javaclasspath set. These interfaces are referred
to as OTK, JOD, and UNO resp., and are preferred in that order by
default (depending on their presence; the OCT interface has lowest
priority). The relevant Java class libs for spreadsheet I/O had
best be added to the javaclasspath by utility function
chk_spreadsheet_support(). For the OTK, JOD and UNO interfaces in
Octave older than 3.8.0, the octave-forge Java package >=1.2.9 is
required. Newer Octave versions should have Java support built-in.
FILENAME must be a valid .ods OpenOffice.org Calc, or Gnumeric,
file name including .ods or .gnumeric suffix. If FILENAME does not
contain any directory path, the file is saved in the current
directory. For UNO bridge, filenames need to be in the form
"file:///<path_to_file>/filename"; a URL will also work. If a
plain file name is given (absolute or relative), odsopen() will try
to transform it into a proper form.
READWRITE must be set to true or numerical 1 if writing to
spreadsheet is desired immediately after calling odsopen(). It
merely serves proper handling of file errors (e.g., "file not
found" or "new file created").
Optional input argument REQINTF can be used to override the ODS
interface automatically selected by odsopen. Currently implemented
interfaces are 'OTK' (Java/ODF Toolkit), 'JOD'
(Java/jOpenDocument), 'UNO' (Java/OpenOffice.org UNO bridge), and
'OCT' (native Octave, for Gnumeric. In most situations this
parameter is unneeded as odsopen automatically selects the most
useful interface present ("default interface"). Depending on file
type, odsopen.m can invoke other detected interfaces than the
default one.
Beware: The UNO interface is still experimental. While in itself
reliable, it may have undesired side effects on Open-/LibreOffice
windows outside Octave.
Examples:
ods = odsopen ('test1.ods');
(get a pointer for reading from spreadsheet test1.ods)
ods = odsopen ('test2.ods', [], 'JOD');
(as above, indicate test2.ods will be read from; in this case using
the jOpenDocument interface is requested)
See also: odsclose, odsread, oct2ods, ods2oct, odsfinfo,
chk_spreadsheet_support.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Get a pointer to an OpenOffice_org spreadsheet in the form of return
argument OD
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
odsread
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6448
-- Function File: [NUMARR, TXTARR, RAWARR, LIMITS] = odsread (FILENAME)
-- Function File: [NUMARR, TXTARR, RAWARR, LIMITS] = odsread (FILENAME,
WSH)
-- Function File: [NUMARR, TXTARR, RAWARR, LIMITS] = odsread (FILENAME,
WSH, RANGE)
-- Function File: [NUMARR, TXTARR, RAWARR, LIMITS, EXTOUT] = odsread
(FILENAME, WSH, RANGE, OPTS, ...)
Read data contained in cell range RANGE in worksheet WSH in
OpenOffice_org Calc spreadsheet file FILENAME. Reading Gnumeric
xml files is also supported.
FILENAME should include the filename extension (e.g., .ods).
WSH is either numerical or text, in the latter case it is
case-sensitive and it should conform to OpenOffice.org Calc or
Gnumeric sheet name requirements. Note that in case of a numerical
WSH this number refers to the position in the worksheet stack,
counted from the left in a Calc window. The default is numerical
1, i.e. the leftmost worksheet in the Calc file.
RANGE is expected to be a regular spreadsheet range format, or ""
(empty string, indicating all data in a worksheet). If no range is
specified the occupied cell range will have to be determined behind
the scenes first; this can take some time. Instead of a
spreadsheet range a Named range defined in the spreadsheet file can
be used as well. In that case the Named range should be specified
as 3rd argument and the value of 2nd argument WSH doesn't matter as
the worksheet associated with the specified Named range will be
used.
If only the first argument is specified, odsread will try to read
all contents from the first = leftmost (or the only) worksheet (as
if a range of '' (empty string) was specified).
If only two arguments are specified, odsread assumes the second
argument to be WSH and to refer to a worksheet. In that case
odsread tries to read all data contained in that worksheet.
After these input arguments a number of optional arguments can be
supplied in any desired order:
INTERFACE
INTERFACE (a three-character text sting) can be used to
override the automatic interface selection by odsread out of
the supported ones: Java/ODFtoolkit ('OTK'),
Java/jOpenDocument ('JOD'), Java/UNO bridge ('UNO'), or native
Octave (OCT). Octave selects one of these, preferrably in the
order above, based on presence of support software and the
file at hand. In addition the OCT interface offers .gnumeric
read support.
Function handle
If a function handle is specified, the pertinent function
(having at most two output arrays) will be applied to the
numeric output data of odsread. Any second output of the
function will be in a 5th output argument EXTOUT of odsread.
Options struct
odsread's output can be influenced to some extent by a number
of options. See OPTIONS in "help ods2oct" for an overview.
Return argument NUMARR contains the numeric data, optional return
arguments TXTARR and RAWARR contain text strings and the raw
spreadsheet cell data, respectively, and LIMITS is a struct
containing the data origins of the various returned arrays. If a
function handle was specified, fifth output array EXTOUT contains
optional second output of the invoked function.
Erroneous data and empty cells are set to NaN in NUMARR and turn up
empty in TXTARR and RAWARR. Date/time values in date/time
formatted cells are returned as numerical values in OBJ with base
1-1-0000. Note that OpenOfice.org and MS-Excel have different date
base values (epoch; 1/1/0000 & 1/1/1900, resp.) and internal
representation so MS-Excel spreadsheets rewritten into .ods format
by OpenOffice.org Calc may have different date base values than
expected. As there's no gnumeric formula evaluator and gnumeric
doesn't store cached formula results, formulas are returned as text
strings when reading from Gnumeric files.
NUMARR and TXTARR are trimmed from empty outer rows and columns, so
any returned array may turn out to be smaller than requested in
RANGE.
When reading from merged cells, all array elements NOT
corresponding to the leftmost or upper spreadsheet cell will be
treated as if the "corresponding" cells are empty.
A native Octave interface (OCT) is available, but presently still
experimental; it offers .gnumeric read support as well. For ODS
only the supported Java-based interfaces offer more flexibility and
better speed. For those you need a Java JRE or JDK and one or both
of jopendocument-<version>.jar or preferrably: (odfdom.jar
(versions 0.7.5 or 0.8.6-0.8.8) & xercesImpl.jar v. 2.9.1) in your
javaclasspath. There is also experimental support invoking
OpenOffice.org/LibreOffice or clones through a Java/UNO bridge.
For Octave older than 3.8.0 the octave-forge Java package >= 1.2.9
is required then; newer Octave versions should have Java support
built-in.
odsread.m is just a wrapper for a collection of scripts that find
out the interface to be used and do the actual reading. For each
call to odsread the interface must be started and the spreadsheet
file read into memory. When reading multiple ranges (in optionally
multiple worksheets) a significant speed boost can be obtained by
invoking those scripts directly (odsopen / ods2oct [/ parsecell] /
... / odsclose). This also offers more flexibility (e.g. formula
results or the formulas themselves; stripping output arrays from
empty enveloping rows/columns).
Examples:
A = odsread ('test4.ods', '2nd_sheet', 'C3:AB40');
(which returns the numeric contents in range C3:AB40 in worksheet
'2nd_sheet' from file test4.ods into numeric array A)
[An, Tn, Ra, limits] = odsread ('Sales2009.ods', 'Third_sheet');
(which returns all data in worksheet 'Third_sheet' in file test4.ods
into array An, the text data into array Tn, the raw cell data into
cell array Ra and the ranges from where the actual data came in limits)
See also: odsopen, ods2oct, oct2ods, odsclose, odswrite, odsfinfo,
parsecell.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Read data contained in cell range RANGE in worksheet WSH in
OpenOffice_org Calc
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
odswrite
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3925
-- Function File: RSTATUS = odswrite (FILENAME, ARR)
-- Function File: RSTATUS = odswrite (FILENAME, ARR, WSH)
-- Function File: RSTATUS = odswrite (FILENAME, ARR, WSH, RANGE)
-- Function File: RSTATUS = odswrite (FILENAME, ARR, WSH, RANGE,
REQINTF)
Add data in 1D/2D array ARR into sheet WSH in OpenOffice_org Calc
spreadsheet file FILENAME in cell range RANGE. Gnumeric files can
also be written.
RSTATUS returns 1 if write succeeded, 0 otherwise.
FILENAME must be a valid .ods OpenOffice.org file name (including
file name extension). If FILENAME does not contain any directory
path, the file is saved in the current directory.
ARR can be any 1D or 2D array containing numerical, logical and/or
character data (cellstr) except complex. Mixed
numeric/logical/text arrays can only be cell arrays.
WSH can be a number or string. In case of a not yet existing
OpenOffice.org spreadsheet, the first sheet will be used & named
according to WSH - no extra empty sheets are created. In case of
existing files, some checks are made for existing sheet names or
numbers, or whether WSH refers to an existing sheet with a type
other than sheet (e.g., chart). When new sheets are to be added to
the spreadsheet file, they are inserted to the right of all
existing sheets. The pointer to the "active" sheet (shown when
OpenOffice.org Calc opens the file) remains untouched.
RANGE is expected to be a regular spreadsheet range. Data is added
to the sheet; existing data in the requested range will be
overwritten. Instead of a spreadsheet range a Named range defined
in the spreadsheet file can be used as well. In that case the
Named range should be specified as 4th argument and the value of
3rd argument WSH doesn't matter as the worksheet associated with
the specified Named range will be used. Array ARR will be clipped
at the right and/or bottom if its size is bigger than can be
accommodated in RANGE. If ARR is smaller than the RANGE allows, it
is placed in the top left rectangle of RANGE and cell values
outside that rectangle will be untouched. If the third argument is
a sheet name and RANGE is specified as just one cell, it is taken
as the topleft cell and the bottomright cell range address is
determinded form the data.
If RANGE contains merged cells, only the elements of ARR
corresponding to the top or left Calc cells of those merged cells
will be written, other array cells corresponding to that cell will
be ignored.
The optional last argument REQINTF can be used to override the
automatic selection by odswrite of one interface out of the
supported ones: Java/ODFtooolkit ('OTK'), Java/jOpenDocument
('JOD'), Java/OpenOffice.org ('UNO'), or native Octave ('OCT'). For
writing gnumeric, the OCT interface is automatically selected and
need not be specified.
odswrite is a mere wrapper for various scripts which find out what
ODS interface to use (ODF toolkit, jOpenDocument, Open/LibreOffice
or native Octave) plus code to mimic the other brand's xlswrite
syntax (and quirks). For each call to odswrite such an interface
must be started and possibly an ODS file loaded. When writing to
multiple ranges and/or worksheets in the same ODS file, a speed
bonus can be obtained by invoking those scripts (odsopen / octods /
.... / odsclose) directly.
Example:
status = odswrite ('test4.ods', 'arr', 'Eight_sheet', 'C3:AB40');
(which adds the contents of array arr (any type) to range C3:AB40
in sheet 'Eight_sheet' in file test4.ods and returns a logical
True (= numerical 1) in status if al went well)
See also: odsread, oct2ods, ods2oct, odsopen, odsclose, odsfinfo.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Add data in 1D/2D array ARR into sheet WSH in OpenOffice_org Calc
spreadsheet fi
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
parsecell
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1431
-- Function File: [ NUMARR, TXTARR, LIM ] = parsecell (RAWARR)
-- Function File: [ NUMARR, TXTARR, LIM ] = parsecell (RAWARR, LIMITS)
Divide a heterogeneous 2D cell array into a 2D numeric array and a
2D cell array containing only strings. Both returned arrays are
trimmed from empty outer rows and columns. This function is
particularly useful for parsing cell arrays returned by functions
reading spreadsheets (e.g., xlsread, odsread).
Optional return argument LIM contains two field with the outer
column and row numbers of NUMARR and TXTARR in the original array
RAWARR. Optional input argument LIMITS can either be the
spreadsheet data limits returned in the spreadsheet file pointer
struct (field xls.limits or ods.limits), or the file ptr struct
itself. If one of these is specified, optional return argument LIM
will contain the real spreadsheet row & column numbers enclosing
the origins of the numerical and text data returned in NUMARR and
TXTARR.
Examples:
[An, Tn] = parsecell (Rn);
(which returns the numeric contents of Rn into array An and the
text data into array Tn)
[An, Tn, lims] = parsecell (Rn, xls.limits);
(which returns the numeric contents of Rn into array An and the
text data into array Tn.)
See also: xlsread, odsread, xls2oct, ods2oct.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Divide a heterogeneous 2D cell array into a 2D numeric array and a 2D
cell array
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
pch2mat
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 422
-- Function File: DATA = pch2mat (FILENAME)
Converts NASTRAN PCH file (SORT2) to a data structure and frequency
vector. A filename as a string is the only needed input.
The output is in the form of struct. containing a freq vector n x
1 called data.f, and the remaining data are in the form of
subcases, point ids and directions respectively. for ex.
data.S1.p254686.x and they are n x 2
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 75
Converts NASTRAN PCH file (SORT2) to a data structure and frequency
vector.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
read_namelist
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 839
S = READ_NAMELIST (FILENAME) returns the struct S containing namelists and
variables in the file FILENAME organised in hierachical way:
|--VAR1
|--VAR2
|-- NMLST_A--|...
| |--VARNa
|
| |--VAR1
|-- NMLST_B--|--VAR2
| |...
S --| ... |--VARNb
|
| |--VAR1
|-- NMLST_M--|--VAR2
|...
|--VARNm
Note: The function can read multidimensional variables as well. The
function assumes that there is no more than one namelist section per
line. At this time there is no syntax checking functionality so the
function will crash in case of errors.
Example:
NMLST = read_namelist ("OPTIONS.nam");
NMLST.NAM_FRAC.XUNIF_NATURE = 0.1;
write_namelist(NMlST, "MOD_OPTIONS.nam");
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
S = READ_NAMELIST (FILENAME) returns the struct S containing namelists and
var
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
rfsearch
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1335
-- Function File: FILENAME = rsearchfile (DNAME, FNAME)
-- Function File: FILENAME = rsearchfile (DNAME, FNAME, MAXDEPTH)
Recursively search for file or filename pattern FNAME starting in
directory DNAME and return the first match.
DNAME and FNAME must be character strings and should conform to the
directory name and filename requirements of your operating system.
Optional argument MAXDEPTH can be specified to limit the maximum
search depth; the default value is 1 (search only in DNAME and
subdirs of DNAME). Setting maxdepth to 0 limits the search to
DNAME. Be careful with setting MAXDEPTH to values > 3 or 4 as this
can provoke excessive search times in densely populated directory
trees. Keep in mind that rfsearch is a recursive function itself.
Output argument FILENAME returns the relative file path of the
first match, relative to DNAME, or an empty character string if no
match was found.
Examples:
filename = rfsearch ("/home/guest/octave", "test.fil")
Look for file test.fil and start the search in /home/guest/octave
filename = rfsearch ("/home", "test.fil", 2)
Look for file test.fil, start the search in /home, and if needed
search subdirs of subdirs of /home
See also: dir, glob.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Recursively search for file or filename pattern FNAME starting in
directory DNAM
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
test_spsh
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 486
-- Function File: [ VOID ] = test_sprdsh ()
Test functionality of supported spreadsheet interfaces.
test_spsh tests simply tests all interfaces that are found to be
supported by chk_spreadsheet_support() function, one by one. It
invokes the functions io_xls_testscript.m and io_ods_testscript.m
for the actual testing.
As it is meant to be used interactively, no output arguments are
returned.
See also: io_xls_testscript, io_ods_testscript.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Test functionality of supported spreadsheet interfaces.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
tidyxml
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 666
-- OSTR = tidyxml (ISTR, CONV_FCN)
Optionally convert character using the function handle in CONV_FCN,
remove characters (<32 >255) from text string or cell array ISTR
and return the result in OSTR.
tidyxml is useful for converting strings in XML that have been
partly or wholly encoded as double-byte characters. Such strings
occur when dealing with a.o., spreadsheet programs reading/writing
from/to XML-based formats and cannot be processed by Octave as
Octave doesn't support unicode. For (optionally: nested) nested
cell arrays tidyxml is called recursively and only processes cells
containing text strings.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Optionally convert character using the function handle in CONV_FCN,
remove chara
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
unicode2utf8
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 265
-- [OSTR, ERROR_FLAG] = unicode2utf8 (USTR)
Encode (1-byte) Unicode string USTR into UTF-8 OSTR.
UTF-8 characters with more than 2 bytes are dropped since Octave
does not support characters >255. If an error occured ERROR_FLAG
is set to true.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Encode (1-byte) Unicode string USTR into UTF-8 OSTR.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
utf82unicode
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 273
-- [USTR, ERROR_FLAG] = utf82unicode (ISTR)
Convert UTF-8 encoded strings ISTR to (1-byte) Unicode USTR.
UTF-8 characters with more than 2 bytes are dropped since Octave
does not support characters >255. If an error occured ERROR_FLAG
is set to true.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
Convert UTF-8 encoded strings ISTR to (1-byte) Unicode USTR.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
write_namelist
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 811
WRITE_NAMELIST(S, FILENAME) writes a namelist data structure S to a
file FILENAME. S should follow the following structure:
|--VAR1
|--VAR2
|-- NMLST_A--|...
| |--VARNa
|
| |--VAR1
|-- NMLST_B--|--VAR2
| |...
S --| ... |--VARNb
|
| |--VAR1
|-- NMLST_M--|--VAR2
|...
|--VARNm
Notes: Only supports variables of type:
Scalars, vectors and 2D numeric arrays (integers and floating points)
Scalars and 1D boolean arrays specified as '.true.' and '.false.' strings
Single and 1D arrays of strings
Example:
NMLST = read_namelist ("OPTIONS.nam");
NMLST.NAM_FRAC.XUNIF_NATURE = 0.1;
write_namelist(NMlST, "MOD_OPTIONS.nam");
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
WRITE_NAMELIST(S, FILENAME) writes a namelist data structure S to a
file FILEN
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
xls2oct
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5235
-- Function File: [ RAWARR, XLS, RSTATUS ] = xls2oct (XLS)
-- Function File: [ RAWARR, XLS, RSTATUS ] = xls2oct (XLS, WSH)
-- Function File: [ RAWARR, XLS, RSTATUS ] = xls2oct (XLS, WSH, RANGE)
-- Function File: [ RAWARR, XLS, RSTATUS ] = xls2oct (XLS, WSH, RANGE,
OPTIONS)
Read data contained within cell range RANGE from worksheet WSH in
an Excel spreadsheet file pointed to in struct XLS; Gnumeric files
can be read as well.
XLS is supposed to have been created earlier by xlsopen in the same
octave session.
WSH is either numerical or text, in the latter case it is
case-sensitive and it may be max. 31 characters long. Note that
in case of a numerical WSH this number refers to the position in
the worksheet stack, counted from the left in an Excel window. The
default is numerical 1, i.e. corresponding to the leftmost
worksheet tab in the Excel file.
RANGE is expected to be either a regular spreadsheet range format,
"" (empty string, indicating all data in a worksheet), or a "Named
range" defined in the spreadsheet file. In case of a Named range,
the worksheet associated with that Named range will be used instead
of the one specified in WSH. If no range is specified the occupied
cell range will have to be determined behind the scenes first; this
can take some time for the Java-based interfaces. Be aware that in
COM/ActiveX interface the used range can be outdated. The
Java-based interfaces are more reliable in this respect albeit much
slower.
Optional argument OPTIONS, a structure, can be used to specify
various read modes by setting option fields in the struct to true
(1) or false (0). Currently recognized option fields are:
"formulas_as_text"
If set to TRUE or 1, spreadsheet formulas (if at all present)
are read as formula strings rather than the evaluated formula
result values. The default value is 0 (FALSE).
'strip_array'
Set the value of this field set to TRUE or 1 to strip the
returned output array RAWARR from empty outer columns and
rows. The spreadsheet cell rectangle limits from where the
data actually came will be updated. The default value is
FALSE or 0 (no cropping). When using the COM interface, the
output array is always cropped.
'convert_utf'
If set to 1 or TRUE, xls2oct tries to do a best job of
converting UTF-8 characters to one-byte characters so that
they display properly in Octave if that uses a terminal that
does not support UTF-8 encoding (e.g., Windows 7 and below).
For the COM interface this conversion is done by libraries
outside Octave so for COM this option has no effect.
If only the first argument XLS is specified, xls2oct will try to
read all contents from the first = leftmost (or the only) worksheet
(as if a range of '' (empty string) was specified).
If only two arguments are specified, xls2oct assumes the second
argument to be WSH. In that case xls2oct will try to read all data
contained in that worksheet.
Return argument RAWARR contains the raw spreadsheet cell data. Use
parsecell() to separate numeric and text values from RAWARR.
Optional return argument XLS contains the pointer struct, If any
data have been read, field XLS.limits contains the outermost column
and row numbers of the actually returned cell range.
Optional return argument RSTATUS will be set to 1 if the requested
data have been read successfully, 0 otherwise.
Erroneous data and empty cells turn up empty in RAWARR. Date/time
values in Excel are returned as numerical values. Note that Excel
and Octave have different date base values (epoch; 1/1/1900 and
1/1/0000, respectively). The epoch of returned date values
depending on interface and version of the support SW. Be aware that
Excel trims RAWARR from empty outer rows & columns, so any returned
cell array may turn out to be smaller than requested in RANGE,
independent of field 'formulas_as_text' in OPTIONS. When using
COM, POI, or UNO interface, formulas in cells are evaluated; if
that fails cached values are retrieved. These may be outdated
depending on Excel's "Automatic calculation" settings when the
spreadsheet was saved.
When reading from merged cells, all array elements NOT
corresponding to the leftmost or upper Excel cell will be treated
as if the "corresponding" Excel cells are empty.
Beware: when the COM interface is used, hidden Excel invocations
may be kept running silently in case of COM errors.
Examples:
A = xls2oct (xls1, '2nd_sheet', 'C3:AB40');
(which returns the numeric contents in range C3:AB40 in worksheet
'2nd_sheet' from a spreadsheet file pointed to in pointer struct xls1,
into numeric array A)
[An, xls2, status] = xls2oct (xls2, 'Third_sheet');
See also: oct2xls, xlsopen, xlsclose, parsecell, xlsread, xlsfinfo,
xlswrite .
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Read data contained within cell range RANGE from worksheet WSH in an
Excel sprea
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
xlsclose
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2042
-- Function File: [XLS] = xlsclose (XLS)
-- Function File: [XLS] = xlsclose (XLS, FILENAME)
-- Function File: [XLS] = xlsclose (XLS, "FORCE")
Close the Excel spreadsheet pointed to in struct XLS, if needed
write the file to disk. Based on information contained in XLS,
xlsclose will determine if the file should be written to disk.
If no errors occured during writing, the xls file pointer struct
will be reset and -if COM interface was used- ActiveX/Excel will be
closed. However if errors occurred, the file pointer will be
untouched so you can clean up before a next try with xlsclose().
Be warned that until xlsopen is called again with the same XLS
pointer struct, hidden Excel or Java applications with associated
(possibly large) memory chunks are kept in memory, taking up
resources. If (string) argument "FORCE" is supplied, the file
pointer will be reset regardless, whether the possibly modified
file has been saved successfully or not. Hidden Excel (COM) or
OpenOffice.org (UNO) invocations may live on, possibly even
impeding proper shutdown of Octave.
FILENAME can be used to write changed spreadsheet files to an other
file than opened with xlsopen(); unfortunately this doesn't work
with JXL (JExcelAPI) interface.
For other file formats than OOXML, ODS or gnumeric, you need
MS-Excel (95 - 2010), and/or the Java package => 1.2.8 plus Apache
POI > 3.5 and/or JExcelAPI and/or OpenXLS and/or OpenOffice.org or
clones installed on your computer + proper javaclasspath set, to
make this function work at all. For Octave >= 3.8.0 the Java
package isn't needed as Java support should be built-in.
XLS must be a valid pointer struct made by xlsopen() in the same
octave session.
Examples:
xls1 = xlsclose (xls1);
(Close spreadsheet file pointed to in pointer struct xls1; xls1 is reset)
See also: xlsopen, xlsread, xlswrite, xls2oct, oct2xls, xlsfinfo.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Close the Excel spreadsheet pointed to in struct XLS, if needed write
the file t
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
xlsfinfo
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3211
-- Function File: [FILETYPE] = xlsfinfo (FILENAME [, REQINTF])
-- Function File: [FILETYPE, SH_NAMES] = xlsfinfo (FILENAME [,
REQINTF])
-- Function File: [FILETYPE, SH_NAMES, FFORMAT] = xlsfinfo (FILENAME [,
REQINTF])
-- Function File: [FILETYPE, SH_NAMES, FFORMAT, NMRANGES] = xlsfinfo
(FILENAME [, REQINTF])
Query Excel spreadsheet file FILENAME for some info about its
contents.
If FILENAME is a recognizable Excel spreadsheet file, FILETYPE
returns the string "Microsoft Excel Spreadsheet", or '' (empty
string) otherwise.
If FILENAME is a recognizable Excel spreadsheet file, optional
argument SH_NAMES contains a Nx2 list (cell array) of sheet names
(and in case Excel is installed: sheet types) and total used data
range for each worksheet contained in FILENAME, in the order (from
left to right) in which they occur in the worksheet stack.
Optional return value FFORMAT currently returns '' (empty string)
unless FILENAME is a readable Excel 97-2003 .xls file or an Excel
2007 .xlsx / .xlsb file in which case FFORMAT is set to
"xlWorkbookNormal". Excel 95 .xls files can only be read through
the JXL (JExcelAPI) or UNO (OpenOffice.org) Java-based interfaces.
Optional return argument NMRANGES is a cell array containing all
named data ranges in the file in the first column, the relevant
sheet and the cell range in the second and third column and if
appropriate the scope of the range in the fourth column. For named
ranges defined for the entire workbook the fourth column entry is
empty. Named ranges only work for the COM, POI, OXS, UNO and OCT
interfaces.
If no return arguments are specified the sheet names are echoed to
the terminal screen; in case of Java interfaces for each sheet the
actual occupied data range is echoed as well. The occupied cell
range will have to be determined behind the scenes first; this can
take some time for the Java-based interfaces. Any Named ranges
defined in the spreadsheet file will be listed on screen as well.
If multiple xls interfaces have been installed, REQINTF can be
specified. This can sometimes be handy, e.g. to get an idea of
occupied cell ranges in each worksheet using different interfaces
(due to cached info and/or different treatment of empty but
formatted cells, each interfaces may give different results).
For OOXML spreadsheets no external SW is required but full POI
and/or UNO support (see xlsopen) may work better or faster; to use
those specify 'poi' or 'uno' for REQINTF. For Excel 95 files use
'com' (windows only), 'jxl' or 'uno'. Gnumeric files can be
explored with the built-in OCT interface (no need to specify
REQINTF then).
Examples:
exist = xlsfinfo ('test4.xls');
(Just checks if file test4.xls is a readable Excel file)
[exist, names] = xlsfinfo ('test4.xls');
(Checks if file test4.xls is a readable Excel file and return a
list of sheet names and -types)
See also: oct2xls, xlsread, xls2oct, xlswrite.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 71
Query Excel spreadsheet file FILENAME for some info about its contents.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
xlsopen
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3425
-- Function File: XLS = xlsopen (FILENAME)
-- Function File: XLS = xlsopen (FILENAME, READWRITE)
-- Function File: XLS = xlsopen (FILENAME, READWRITE, REQINTF)
Get a pointer to an Excel spreadsheet in the form of return
argument (file pointer struct) XLS. After processing the
spreadsheet, the file pointer must be explicitly closed by calling
xlsclose().
Calling xlsopen without specifying a return argument is fairly
useless!
xlsopen works with interfaces, which are links to external
software. For I/O from/to OOXML (Excel 2007 and up), ODS 1.2 and
Gnumeric, no additional software is required when the OCT interface
is used (see below). For all other spreadsheet formats, you need
one or more of MS-Excel (95 - 2013), or a Java JRE plus Apache POI
>= 3.5 and/or JExcelAPI and/or OpenXLS and/or OpenOffice.org (or
clones) installed on your computer + proper javaclasspath set.
These interfaces are referred to as COM, POI, JXL, OXS, and UNO,
resp., and are preferred in that order by default (depending on
their presence). Currently the OCT interface has the lowest
priority as it is still experimental. For OOXML read/write support
in principle no additional SW is needed. However, the COM, POI and
UNO interfaces may provide better OOXML write performance and/or
more flexibility. Excel'95 spreadsheets (BIFF5) can only be read
using the COM (Excel-ActiveX), JXL (JExcelAPI), and UNO
(Open-/LibreOffice) interfaces.
FILENAME should be a valid .xls or .xlsx Excel file name (including
extension). But if you use the COM interface you can specify any
extension that your installed Excel version can read AND write; the
same goes for UNO (OpenOffice.org). Using the other Java
interfaces, only .xls or .xlsx are allowed. If FILENAME does not
contain any directory path, the file is saved in the current
directory. Reading/writing .xlsm and .xlsb files may be possible
using the COM and UNO interfaces only, but is untested.
If READWRITE is set to 0 (default value) or omitted, the
spreadsheet file is opened for reading. If READWRITE is set to
true or 1, a spreadsheet file is opened (or created) for reading &
writing.
Optional input argument REQINTF can be used to override the Excel
interface that otherwise is automatically selected by xlsopen.
Currently implemented interfaces (in order of preference) are 'COM'
(Excel/COM), 'POI' (Java/Apache POI), 'JXL' (Java/JExcelAPI), 'OXS'
(Java/OpenXLS), 'UNO' (Java/OpenOffice.org - EXPERIMENTAL!), or
'OCT' (native Octave). In most situations this parameter is
unneeded as xlsopen automatically selects the most useful interface
present.
Beware: Excel invocations may be left running invisibly in case of
COM errors or forgetting to close the file pointer. Similarly for
OpenOffice.org which may even prevent Octave from being closed.
Examples:
xls = xlsopen ('test1.xls');
(get a pointer for reading from spreadsheet test1.xls)
xls = xlsopen ('test2.xls', 1, 'POI');
(as above, indicate test2.xls will be written to; in this case using Java
and the Apache POI interface are requested)
See also: xlsclose, xlsread, xlswrite, xls2oct, oct2xls, xlsfinfo.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Get a pointer to an Excel spreadsheet in the form of return argument
(file point
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
xlsread
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7290
-- Function File: [NUMARR, TXTARR, RAWARR, LIMITS] = xlsread (FILENAME)
-- Function File: [NUMARR, TXTARR, RAWARR, LIMITS] = xlsread (FILENAME,
WSH)
-- Function File: [NUMARR, TXTARR, RAWARR, LIMITS] = xlsread (FILENAME,
RANGE)
-- Function File: [NUMARR, TXTARR, RAWARR, LIMITS] = xlsread (FILENAME,
WSH, RANGE)
-- Function File: [NUMARR, TXTARR, RAWARR, LIMITS, EXTOUT] = xlsread
(FILENAME, WSH, RANGE, OPTIONS, ...)
Read data contained in range RANGE from worksheet WSH in Excel
spreadsheet file FILENAME. Gnumeric files can also be read.
Return argument NUMARR contains the numeric data, optional return
arguments TXTARR and RAWARR contain text strings and the raw
spreadsheet cell data, respectively. Return argument LIMITS
contains the outer column/row numbers of the read spreadsheet range
where NUMARR, TXTARR and RAWARR have come from (remember, xlsread
trims outer rows and columns).
If FILENAME does not contain any directory, the file is assumed to
be in the current directory. The filename extension (.xls or
.xlsx) must be included in the file name; when using the COM
interface all file formats can be read that are supported by the
locally installed MS-Excel version (e.g., wk1, csv, dbf, .xlsm,
etc.). The same holds for UNO (OpenOffice.org or LibreOffice).
RANGE is expected to be a regular spreadsheet range format, or ""
(empty string, indicating all data in a worksheet). If no range is
specified the occupied cell range will have to be determined behind
the scenes first; this can take some time for the Java-based
interfaces (but the results may be more reliable than that of
ActiveX/COM). Instead of a spreadsheet range a Named range defined
in the spreadsheet file can be used as well. In that case the
Named range should be specified as 3rd argument and the value of
2nd argument WSH doesn't matter as the worksheet associated with
the specified Named range will be used.
WSH is either numerical or text; in the latter case it is
case-sensitive and it may be max. 31 characters long. Note that
in case of a numerical WSH this number refers to the position in
the worksheet stack, counted from the left in an Excel window. The
default is numerical 1, i.e. corresponding to the leftmost
worksheet tab in the spreadsheet file.
If only the first argument is specified, xlsread will try to read
all contents (as if a range of '' (empty string) was specified)
from the first = leftmost (or the only) worksheet
If only two arguments are specified, xlsread assumes the second
argument to be RANGE if it is a string argument and contains a ":"
or if it is '' (empty string), and in those cases assumes the data
must be read from the first worksheet (not necessarily Sheet1! but
the leftmost sheet).
However, if only two arguments are specified and the second
argument is numeric or a text string that does not contain a ":",
it is assumed to be WSH and to refer to a worksheet. In that case
xlsread tries to read all data contained in that worksheet.
To be able to use Named ranges, the second input argument should
refer to a worksheet and the third should be the Named range.
After these input arguments a number of optional arguments can be
supplied in any desired order:
INTERFACE
INTERFACE (a three-character text sting) can be used to
override the automatic interface selection by xlsread out of
the supported ones: COM/Excel, Java/Apache POI,
Java/JExcelAPI, Java/OpenXLS, Java/UNO (OpenOffice.org), or
native Octave (in that -built in- order of preference). For
I/O to/from .xlsx files a value of 'com', 'poi', 'uno', or
'oct' must be specified for REQINTF (see help for xlsopen).
For Excel'95 files use 'com', or if Excel is not installed use
'jxl', 'basic' or 'uno'. POI can't read Excel'95 but will try
to fall back to JXL. As REQINTF can also be a cell array of
strings, one can select or exclude one or more interfaces. In
addition the OCT interface offers .gnumeric read support.
Function handle
If a function handle is specified, the pertinent function
(having at most two output arrays) will be applied to the
numeric output data of xlsread. Any second output of the
function will be in a 5th output argument EXTOUT of xlsread.
Options struct
xlsread's output can be influenced to some extent by a number
of options. See OPTIONS in "help xls2oct" for an overview.
Erroneous data and empty cells are set to NaN in NUMARR and turn up
empty in TXTARR and RAWARR. Date/time values in Excel are returned
as numerical values in NUMARR. Note that Excel and Octave have
different date base values (epoch; 1/1/1900 & 1/1/0000, resp.).
When using the COM interface, spreadsheet date values lying before
1/1/1900 are returned as strings, formatted as they appear in the
spreadsheet. The returned date format for other interfaces depend
on interface type and support SW version. NUMARR and TXTARR are
trimmed from empty outer rows and columns. Be aware that Excel
does the same for RAWARR, so any returned array may turn out to be
smaller than requested in RANGE. Use the fourth return argument
LIMS for info on the cell ranges your date came from.
When reading from merged cells, all array elements NOT
corresponding to the leftmost or upper Excel cell will be treated
as if the "corresponding" Excel cells are empty.
xlsread is just a wrapper for a collection of scripts that find out
the interface to be used (COM, Java/POI, Java/JXL Java/OXS,
Java/UNO, OCT) and do the actual reading. For each call to xlsread
the interface must be started and the Excel file read into memory.
When reading multiple ranges (in optionally multiple worksheets) a
significant speed boost can be obtained by invoking those scripts
directly as in: xlsopen / xls2oct [/ parsecell] / ... / xlsclose
Beware: when using the COM interface, hidden Excel invocations may
be kept running silently if not closed explicitly.
Examples:
A = xlsread ('test4.xls', '2nd_sheet', 'C3:AB40');
(which returns the numeric contents in range C3:AB40 in worksheet
'2nd_sheet' from file test4.xls into numeric array A)
[An, Tn, Ra, limits] = xlsread ('Sales2009.xls', 'Third_sheet');
(which returns all data in worksheet 'Third_sheet' in file 'Sales2009.xls'
into array An, the text data into array Tn, the raw cell data into
cell array Ra and the ranges from where the actual data came in limits)
numarr = xlsread ('Sales2010.xls', 4, [], {'JXL', 'COM'});
(Read all data from 4th worksheet in file Sales2010.xls using either JXL
or COM interface (i.e, exclude POI interface).
See also: xlswrite, xlsopen, xls2oct, xlsclose, xlsfinfo, oct2xls.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Read data contained in range RANGE from worksheet WSH in Excel
spreadsheet file
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
xlswrite
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5638
-- Function File: RSTATUS = xlswrite (FILENAME, ARR)
-- Function File: RSTATUS = xlswrite (FILENAME, ARR, WSH)
-- Function File: RSTATUS = xlswrite (FILENAME, ARR, WSH, RANGE)
-- Function File: RSTATUS = xlswrite (FILENAME, ARR, WSH, RANGE,
REQINTF)
Add data in 1D/2D array ARR to worksheet WSH in Excel spreadsheet
file FILENAME in cell range RANGE. Gnumeric files can also be
written.
RSTATUS returns 1 if writing succeeded, 0 otherwise.
FILENAME must be a valid Excel file name (including file name
extension). If FILENAME does not contain any directory path, the
file is saved in the current directory. Writing .xlsm and .xlsb is
untested but may only reliably be possible with the COM and UNO
interfaces.
ARR can be any 1D or 2D array containing numerical, logical and/or
character data (cellstr) except complex. Mixed numeric/text arrays
can only be cell arrays.
If only 3 arguments are given, the 3rd is assumed to be a
spreadsheet range if it contains a ":" or is a completely empty
string (interpreted as A1:IV65336 for regular .xls or A1:XFD1048576
for OOXML .xlsx). The 3rd argument is assumed to refer to a
worksheet if it is a numeric value or a non-empty text string not
containing ":"
WSH can be a number or string (max. 31 chars). In case of a not
yet existing Excel file, the first worksheet will be used & named
according to WSH - the extra worksheets that Excel usually creates
by default are deleted (COM) or simply not created. In case of
existing files, some checks are made for existing worksheet names
or numbers, or whether WSH refers to an existing sheet with a type
other than worksheet (e.g., chart). When new worksheets are to be
added to the Excel file, they are inserted to the right of all
existing worksheets. The pointer to the "active" sheet (shown when
Excel opens the file) remains untouched.
RANGE is expected to be a regular spreadsheet range. Data is added
to the worksheet; existing data in the requested range will be
overwritten. Instead of a spreadsheet range a Named range defined
in the spreadsheet file can be used as well. In that case the
Named range should be specified as 4th argument and the value of
3rd argument WSH doesn't matter as the worksheet associated with
the specified Named range will be used. Array ARR will be clipped
at the right and/or bottom if its size is bigger than can be
accommodated in RANGE. If ARR is smaller than the RANGE allows, it
is placed in the top left rectangle of RANGE and remaining cell
values outside the rectangle will be retained. If the third
argument is a sheet name and RANGE is specified as just one cell,
it is taken as the topleft cell and the bottomright cell range
address is determinded form the data.
If RANGE contains merged cells, only the elements of ARR
corresponding to the top or left Excel cells of those merged cells
will be written, other array cells corresponding to that merged
cell will be ignored. In other words, merged spreadsheet cells
won't be "unmerged".
As to the optional last argument REQINTF: When no external support
SW for spreadsheet I/O ('interface') is installed (see below),
xlsread can only write to .xlsx, .ods and .gnumeric files using the
default (built-in) 'OCT' interface. If external support SW is
installed, xlswrite will try locate it automatically and invoke it,
allowing more file types to be written. Multiple spreadsheet I/O
'interfaces' can be installed side-by-side; xlswrite will then try
to invoke the most suitable one depending on file type. The
optional last argument REQINTF can be used to override that
automatic selection by xlswrite. Supported interfaces comprise:
'com' (ActiveX/Excel), 'poi' (Java/Apache POI), 'jxl'
(Java/JExcelAPI), 'uno' (Java/OpenOffice.org), or 'oct' (native
Octave w/o any external support software). 'oxs' (Java/OpenXLS)
works reliably and fast for .xls (BIFF8) but has been disabled for
writing OOXML as that is too buggy. For writing to OOXML files
(.xlsx) a value of 'com', 'poi', 'uno', or 'oct' must be specified
for REQINTF. The value of REQINTF is case-insensitive. Multiple
interfaces can be selected if entered as a cell array of strings.
Writing gnumeric files can only be done with the OCT interface, it
is selected automatically for that file type.
xlswrite is a mere wrapper for various scripts which find out what
Excel interface to use (COM, POI, etc) plus code to mimic the other
brand's syntax. For each call to xlswrite such an interface must
be started and possibly an Excel file loaded. When writing to
multiple ranges and/or worksheets in the same Excel file, a speed
bonus can be obtained by invoking those scripts directly with
multiple calls to oct2xls (one for each sheet or range) surrounded
by one call to xlsopen and xlsclose: (xlsopen / octxls / oct2xls /
.... / xlsclose)
Examples:
status = xlswrite ...
('test4.xls', 'arr', 'Third_sheet', 'C3:AB40');
(which adds the contents of array arr (any type) to
rangeC3:AB40 in worksheet 'Third_sheet' in file
test4.xls and returns a logical True (= numerical 1)
in 'status' if all went well)
See also: xlsread, oct2xls, xls2oct, xlsopen, xlsclose, xlsfinfo.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Add data in 1D/2D array ARR to worksheet WSH in Excel spreadsheet file
FILENAME
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
xmlread
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 750
-- Function File: NODE = xmlread (FNAME)
Parse an xml file FNAME using Xerces Java library and return a Java
object representing an xml DOM document.
Octave does not ship with a Xerces library so you should take care
of adding the required .jar files to your java_path, e.g:
javaaddpath ("/path/to/xerces-2_11_0/xercesImpl.jar");
javaaddpath ("/path/to/xerces-2_11_0/xml-apis.jar");
xmlread will check for Java support and proper xerces Java
libraries in the javaclasspath until the check passes, or if it is
called without arguments. In the latter case it will return the
found xerces entries in the javaclasspath and xerces version to
standard output.
See also: xmlwrite.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Parse an xml file FNAME using Xerces Java library and return a Java
object repre
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
xmlwrite
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 851
-- Function File: xmlwrite (FNAME, DOM)
-- Function File: STR = xmlwrite (DOM)
Write an xml DOM document to file FNAME or to ouput string STR.
The DOM argument must be a DOM document object as returned by
'xmlread' function.
Octave does not ship with the necessary Xerces library so you
should take care of adding the required .jar files to your
javaclasspath, e.g:
javaaddpath ("/path/to/xerces-2_11_0/xercesImpl.jar");
javaaddpath ("/path/to/xerces-2_11_0/xml-apis.jar");
xmlwrite will check for Java support and proper xerces Java
libraries in the javaclasspath until the check passes, or if it is
called without arguments. In the latter case it will also return
the found xerces javaclasspath entries and xerces version to
standard output.
See also: xmlread.
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
Write an xml DOM document to file FNAME or to ouput string STR.
|