All Projects → libxls → Libxls

libxls / Libxls

Licence: other
Read binary Excel files from C/C++

Programming Languages

c
50402 projects - #5 most used programming language

Labels

Projects that are alternatives of or similar to Libxls

Localizable.strings2excel
Python command line tool for conversion between iOS strings files and excel files & between android strings.xml files and excl files. & strings files to android strings.xml files.
Stars: ✭ 424 (+198.59%)
Mutual labels:  excel, xls
Rows
A common, beautiful interface to tabular data, no matter the format
Stars: ✭ 739 (+420.42%)
Mutual labels:  excel, xls
Docjure
Read and write Office documents from Clojure
Stars: ✭ 510 (+259.15%)
Mutual labels:  excel, xls
J
❌ Multi-format spreadsheet CLI (now merged in http://github.com/sheetjs/js-xlsx )
Stars: ✭ 343 (+141.55%)
Mutual labels:  excel, xls
Spreadsheet
The Ruby Spreadsheet by ywesee GmbH
Stars: ✭ 1,033 (+627.46%)
Mutual labels:  excel, xls
Npoi.mapper
Use this tool to import or export data with Excel file. The tool is a convention based mapper between strong typed object and Excel data via NPOI.
Stars: ✭ 348 (+145.07%)
Mutual labels:  excel, xls
Sheetjs
📗 SheetJS Community Edition -- Spreadsheet Data Toolkit
Stars: ✭ 28,479 (+19955.63%)
Mutual labels:  excel, xls
spark-hadoopoffice-ds
A Spark datasource for the HadoopOffice library
Stars: ✭ 36 (-74.65%)
Mutual labels:  excel, xls
Desktopeditors
An office suite that combines text, spreadsheet and presentation editors allowing to create, view and edit local documents
Stars: ✭ 1,008 (+609.86%)
Mutual labels:  excel, xls
Pyexcel
Single API for reading, manipulating and writing data in csv, ods, xls, xlsx and xlsm files
Stars: ✭ 902 (+535.21%)
Mutual labels:  excel, xls
dbd
dbd is a database prototyping tool that enables data analysts and engineers to quickly load and transform data in SQL databases.
Stars: ✭ 30 (-78.87%)
Mutual labels:  excel, xls
Myexcel
MyExcel, a new way to operate excel!
Stars: ✭ 1,198 (+743.66%)
Mutual labels:  excel, xls
exoffice
Library to parse common excel formats (xls, xlsx, csv)
Stars: ✭ 31 (-78.17%)
Mutual labels:  excel, xls
Easyexcel
快速、简单避免OOM的java处理Excel工具
Stars: ✭ 22,133 (+15486.62%)
Mutual labels:  excel, xls
csv2xls
Put together some CSV files into a single Excel file, in different sheets.
Stars: ✭ 14 (-90.14%)
Mutual labels:  excel, xls
Readxl
Read excel files (.xls and .xlsx) into R 🖇
Stars: ✭ 585 (+311.97%)
Mutual labels:  excel, xls
eec
A fast and lower memory excel write/read tool.一个非POI底层,支持流式处理的高效且超低内存的Excel读写工具
Stars: ✭ 93 (-34.51%)
Mutual labels:  excel, xls
spreadsheet
Yii2 extension for export to Excel
Stars: ✭ 79 (-44.37%)
Mutual labels:  excel, xls
Tableexport
The simple, easy-to-implement library to export HTML tables to xlsx, xls, csv, and txt files.
Stars: ✭ 781 (+450%)
Mutual labels:  excel, xls
Documentbuilder
ONLYOFFICE Document Builder is powerful text, spreadsheet, presentation and PDF generating tool
Stars: ✭ 61 (-57.04%)
Mutual labels:  excel, xls

Build Status Build Status Fuzzing Status

libxls - Read XLS files from C

This is libxls, a C library for reading Excel files in the nasty old binary OLE format, plus a command-line tool for converting XLS to CSV (named, appropriately enough, xls2csv).

After several years of neglect, libxls is under new management as of the 1.5.x series. Head over to releases to get the latest stable version of libxls 1.5, which fixes many security vulnerabilities found in libxls 1.4 and earlier.

Libxls 1.5 also includes new APIs for parsing files stored in memory buffers, and returns errors instead of exiting upon encountering malformed input. If you find a bug, please file it on the GitHub issue tracker.

Changes to libxls since 1.4:

  • Hosted on GitHub (hooray!)
  • New in-memory parsing API (see xls_open_buffer)
  • Internals rewritten to return errors instead of exiting
  • Heavily fuzz-tested with clang's libFuzzer, fixing many memory leaks and CVEs
  • Improved compatibility with C++
  • Continuous integration tests on Mac, Linux, and Windows
  • Lots of other small fixes, see the commit history

The C API is pretty simple, this will get you started:

xls_error_t error = LIBXLS_OK;
xlsWorkBook *wb = xls_open_file("/path/to/finances.xls", "UTF-8", &error);
if (wb == NULL) {
    printf("Error reading file: %s\n", xls_getError(error));
    exit(1);
}
for (int i=0; i<wb->sheets.count; i++) { // sheets
    xlsWorkSheet *work_sheet = xls_getWorkSheet(work_book, i);
    error = xls_parseWorkSheet(work_sheet);
    for (int j=0; j<=work_sheet->rows.lastrow; j++) { // rows
        xlsRow *row = xls_row(work_sheet, j);
        for (int k=0; k<=work_sheet->rows.lastcol; k++) { // columns
            xlsCell *cell = &row->cells.cell[k];
            // do something with cell
            if (cell->id == XLS_RECORD_BLANK) {
                // do something with a blank cell
            } else if (cell->id == XLS_RECORD_NUMBER) {
               // use cell->d, a double-precision number
            } else if (cell->id == XLS_RECORD_FORMULA) {
                if (strcmp(cell->str, "bool") == 0) {
                    // its boolean, and test cell->d > 0.0 for true
                } else if (strcmp(cell->str, "error") == 0) {
                    // formula is in error
                } else {
                    // cell->str is valid as the result of a string formula.
                }
            } else if (cell->str != NULL) {
                // cell->str contains a string value
            }
        }
    }
    xls_close_WS(work_sheet);
}
xls_close_WB(wb);

The library also includes a CLI tool for converting Excel files to CSV:

./xls2csv /path/to/file.xls

The man page for xls2csv has more details.

Libxls should run fine on both little-endian and big-endian systems, but if not please open an issue.

If you want to hack on the source, you should first familiarize yourself with the Microsoft Excel File Format as well as Compound Document file format (documentation provided by the nice folks at OpenOffice.org).

Installation

If you want a stable version, check out the Releases section, which has copies of everything you'll find in Sourceforge, and download version 1.5.0 or later.

For full instructions see INSTALL, or here's the tl;dr:

To install a stable release:

./configure
make
make install

If you've cloned the git repository, you'll need to run this first:

./bootstrap

That will generate all the supporting files. It assumes autotools is already installed on the system (and also expects Autoconf Archive to be present).

Language bindings

If C is not your cup of tea, you can make use of libxls in several other languages, including:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].