XLSX I/O
|
Cross-platform C library for reading values from and writing values to .xlsx files.
XLSX I/O aims to provide a C library for reading and writing .xlsx files. The .xlsx file format is the native format used by Microsoft(R) Excel(TM) since version 2007.
The library was written with the following goals in mind:
Reading .xlsx files:
Writing .xlsx files:
The following libraries are provided:
-lxlsxio_read
- library for reading .xlsx files, requires #include <xlsxio_read.h>
-lxlsxio_write
- library for writing .xlsx files, requires #include <xlsxio_write.h>
-lxlsxio_readw
- experimental library for reading .xlsx files, linked with -lexpatw
, requires #define XML_UNICODE
before #include <xlsxio_read.h>
Some command line utilities are included:
xlsxio_xlsx2csv
- converts all sheets in all specified .xlsx files to individual CSV (Comma Separated Values) files.xlsxio_csv2xlsx
- converts all specified CSV (Comma Separated Values) files to .xlsx files.This project has the following depencancies:
Note that minizip is preferred, as there have been reports that .xlsx files generated with XLSX I/O built against libzip can't be opened with LibreOffice.
There is no dependancy on Microsoft(R) Excel(TM).
XLSX I/O was written with cross-platform portability in mind and works on multiple operating systems, including Windows, macOS and Linux.
Requirements:
There are 2 methods to build XLSX I/O:
Building with make
make install
optionally followed by:PREFIX=<path>
- Base path were files will be installed (defaults to /usr/local)WITH_LIBZIP=1
- Use libzip instead of minizipWIDE=1
- Also build UTF-16 library (xlsxio_readw)STATICDLL=1
- Build a static DLL (= doesn't depend on any other DLLs) - only supported on WindowsBuilding with CMake (preferred method)
cmake -G"Unix Makefiles"
(or cmake -G"MSYS Makefiles"
on Windows) optionally followed by:-DCMAKE_INSTALL_PREFIX:PATH=<path>
Base path were files will be installed-DBUILD_STATIC:BOOL=OFF
- Don't build static libraries-DBUILD_SHARED:BOOL=OFF
- Don't build shared libraries-DBUILD_TOOLS:BOOL=OFF
- Don't build tools (only libraries)-DBUILD_EXAMPLES:BOOL=OFF
- Don't build examples-DBUILD_EXAMPLES:BOOL=OFF
- Don't build examples-DWITH_LIBZIP:BOOL=ON
- Use libzip instead of Minizip-DLIBZIP_DIR:PATH=<path>
- Location of libzip library-DMINIZIP_DIR:PATH=<path>
- Location of Minizip library-DWITH_WIDE:BOOL=ON
- Also build UTF-16 library (libxlsxio_readw)make install
(or make install/strip
to strip symbols)Prebuilt binaries are also available for download for the following platforms:
Both Windows versions were built using the MinGW-w64 under an MSYS2 shell. To link with the .dll libraries from Microsoft Visual C++ you need a .lib file for each .dll. This file can be generated using the lib
tool that comes with Microsoft Visual C++.
For 32-bit Windows:
For 64-bit Windows:
XLSX I/O is released under the terms of the MIT License (MIT), see LICENSE.txt.
This means you are free to use XLSX I/O in any of your projects, from open source to commercial.
This library does not require Microsoft(R) Excel(TM) to be installed.