Looking for the latest version? Download libxls-1.4.0.zip (428.8 kB)
Home
Name Modified Size Downloads / Week Status
Totals: 3 Items   434.3 kB 84
libxls-old 2013-03-19 104 weekly downloads
libxls-1.4.0.zip 2014-01-11 428.8 kB 8080 weekly downloads
README.txt 2014-01-11 5.5 kB 44 weekly downloads
libxls - Extract Cell Data From Excel xls files Current Version 1.4.0 - lasted updated January 11, 2014 *** NEWS MAY 2012 *** The license has been converted to BSD. The library is now ARM friendly (ARMv7) and it runs on the iPhone using a new ObjectiveC wrapper based on the C++ wrapper: https://github.com/dhoerl/DHlibxls Note that the ObjectiveC wrapper builds using the latest source from SVN so you do NOT need to download the library here. ********************* This library can read Excel .xls files and allow you to access cell values and retrieve other information (like the worksheet properties). A simple example of how to access all cells appears at the end of this file. There is a utility to convert an excel file to CSV format, or to formatted HTML (see the test directory). xls2csv test.xls > test.csv To build the library, either use svn checkout or download the latest official release. Then: #./bootstrap # may need to do this if you get errors not running it ./configure # optionally use --program-prefix=lib to get libxls2csv make make install RELEASE HISTORY: Release 1.4.0 Jan 11, 2014 Bug Fixes: - MULRK and MULBLANK were not properly decode - sign extension caused spreadsheets with more than 32000 rows to crash - certain formulas were not properly decoded (those that returned BOOL and Error codes) - possibly other small changes, nothing major Other Changes: - some internal routines poluted the name space with "convert..." names, changed to "xlsConvert..." - added two files in a "formulas" directory that can be used to dump the internal Excel formulas This is of most use to users of xlslib, who want to see the binary representation of an Excel formula It works by registering a "dump" method, see the xlsformula.h file for specifics on usage. Release 1.3.4 Mar 19, 2013 - a few minor bug fixes and more diagnostic messages Release 1.3.3 Feb 18, 2013 - (Evan Miller) fixed negative values stored in RK objects Release 1.3.2 Feb 6, 2013 - (Evan Miller) fixed a problem where cell->l could be a pointer or a value - (Evan Miller) added a flag for is1904 Release 1.3.1 May 5, 2012 - now under a BSD license (ObjectiveC framework [on github], C++ interface, C source) Release 1.3.0 March 24, 2012 - Fixed a bug with Unicode strings that only used 8-bit code points were not converted to UTF-8. - Replaced a huge static string with dynamic strings created by asprintf(). Release 1.2.1 March 5, 2012 - When refactoring, cells with strings in them did not return the string values (proverbial 1 line fix)! Release 1.2.0 January 16, 2012 - C++ wrapper provides a nice high level interface to the library * interator to get all non-blank cells * uses 1 based rows, use numbers or alpha style column identifiers * supports both strings and wstrings (you can elect one or the other) * random access using sheet/row/column - library is more C++ friendly even when used without the wrapper - headers restructured so that only xls.h appears in the include directory (others are in a libels subdirectory - so please insure old ones removed) - pack() issues should be fully addressed - the library builds cleanly now in both 32 and 64 bit modes. - "make check" runs the test program - all open bugs and patch requests addressed Release 1.1.0 December 30, 2011 - updated all the auto* files for libtool 2.2.10 (to add -std=C99 and the program prefix) - file name assumed to be utf-8 or ascii (charset not applied to them - fixes some user bugs) This means UCS-2 encoding etc should now work properly Release 1.0.0 December 26, 2011 - fixed a bunch of memory leaks found by valgrind - fixed memory problems causes by under allocating memory - this project is solid enough now to earn a "1" designation Release 0.3.0 May 8, 2009 - direct access to cell data: New functions xls_row and xls_cell to get cell content. xlsRow* xls_row(xlsWorkSheet* pWS, WORD cellRow); xlsCell* xls_cell(xlsWorkSheet* pWS, WORD cellRow, WORD cellCol); - can read formula results if(cell->id == 0x06) { // formula if(cell->l == 0) { // its a number ... use cell->d } else { if(cell->str == "bool") // its boolean, and test cell->d > 0.0 for true if(cell->str == "error") // formula is in error else ... cell->str is valid as the result of a string formula. } // Simple main.c file that uses the library to dump all cells: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <libxls/xls.h> int main(int argc, char *argv[]) { xlsWorkBook* pWB; xlsWorkSheet* pWS; unsigned int i; if(argc != 2) { printf("Need file arg\n"); exit(0); } struct st_row_data* row; WORD t,tt; pWB=xls_open(argv[1], "UTF-8"); if (pWB!=NULL) { pWS=xls_getWorkSheet(pWB, 0); // first sheet xls_parseWorkSheet(pWS); for (t=0;t<=pWS->rows.lastrow;t++) { row=&pWS->rows.row[t]; xls_showROW(row); for (tt=0;tt<=pWS->rows.lastcol;tt++) { xlsCell *cell = &row->cells.cell[tt]; if(cell->id == 0x201) continue; xls_showCell(cell); } } xls_showBookInfo(pWB); xls_close_WS(pWS); // close every sheet you open xls_close_WB(pWB); // close the sheet - can use xls_close(pWB) too } else { printf("pWB == NULL\n"); } return 0; }
Source: README.txt, updated 2014-01-11