libxls

Project hosted by SourceForge.net Logo

What is libxls ?

libxls is a C library which can read Excel (xls) files. It has been tested on Linux x86 and Cygwin but may work on any little-endian system. It is not compatible with big endian systems.

libxls can read excel files since Excel 97 (the BIFF8 format)

libxls cannot write Excel files.

libxls is also shipped with xls2csv, a tool which converts an xls file to a csv format, more suitable for parsing.

The OpenOffice.org's Documentation of the Microsoft Excel File Format and OpenOffice.org's Coumpound Document file format were of much help to correct bugs in libxls.

Download

Current version

At the moment, you can only build libxls from sources: libxls 0.1.0.

Previous version (first release)

This version contained a php extension to parse XLS files, not included in the automatic build process, and only distributed as a Windows DLL.
libxls 0.0.1 beta

How to use libxls ?

libxls is a C library

#include <stdio.h>
#include <xls.h>

How to use xls2csv ?

xls2csv takes as its first argument the name of an Excel file. It write to standard output the file converted to csv format.

For example, we can convert the file test.xls into a csv file called test.csv with the following command:

xls2csv test.xls > test.csv

Bugs corrected since the last version

  1. OLE2 file header id is now checked
  2. Corrected wrong fcell usage which could lead to cell moves on a row
  3. There was always one more empty cell on the right on each row
  4. Some formattings in xls_getfcell where incorrects
  5. Corrected some reading problems with SST having CONTINUE records