Open and read Excel from a Linux based C program?

2020-06-17 05:50发布

问题:

I am trying to locate a set of source code that would allow me to open and read the contents of an Excel file on Linux from within a C program.

I dont really want to link it to OpenOffice SDK if I can find something that just does these two things.

carl

回答1:

If following suites you, then You may take read routines from

Sourceforge

and write routines from

What is a simple and reliable C library for working with Excel files?



回答2:

As far as I know there is no library that does this. The common method is always to save the file as CVS in Excel, although then markup etc. is lost.

You could try to use the Excel plugin of Gnumeric:

http://svn.gnome.org/viewvc/gnumeric/trunk/plugins/excel/

It works very well (inside gnumeric).



回答3:

You can use xlhtml to convert the Excel files into HTML, and then use your favorite HTML parser to extract the cell data.



回答4:

Check out the answers to What is the best C library that can access Excel files?

Possible things for you to look at:

  • C : xlsLib
  • C++ : LibExcel

Though I think both are write-only, which is perhaps not what you need.



回答5:

Grab the xls reading code from Open Office.



回答6:

why don't you just use Google Docs? With Gears it has offline support and you can edit files too, just a thought - http://docs.google.com



回答7:

Check out XLSX I/O at https://sourceforge.net/projects/xlsxio/ It is a cross platform C library to read from and write to Excel .xslx files. Works on Windows, OS X, Linux and does not require Excel or Office to be installed. It is intended for sequential access to data in .xlsx files, so if it's only the values you are interested in this is what you need.



标签: c linux excel