用于加载 Excel (.xls) 文件的 C++ 库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2876720/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
C++ library to load Excel (.xls) files
提问by Jake88
I'm looking for a free C++ library that can load .xls files in both Windows and Linux. If I had to make a choice, Linux would be the bare minimum.
我正在寻找一个可以在 Windows 和 Linux 中加载 .xls 文件的免费 C++ 库。如果我必须做出选择,Linux 将是最低要求。
I've tried LibXL, but got this amazing error:
我试过 LibXL,但遇到了这个惊人的错误:
"can't read more cells in trial version"
“无法在试用版中读取更多单元格”
So now I'm on the hunt for a free version :), unfortunately xlsLib doesn't provide the ability to load existing .xls files.
所以现在我正在寻找免费版本:),不幸的是 xlsLib 不提供加载现有 .xls 文件的能力。
Thanks
谢谢
回答by dtw
We have had success with: ExcelFormat
我们在以下方面取得了成功:ExcelFormat
回答by user357269
This looks promising for .xslx files: https://github.com/tfussell/xlnt
这对于 .xslx 文件看起来很有希望:https: //github.com/tfussell/xlnt
回答by Brecht Sanders
Please take a look at XLSX I/O, which is a C library released under MIT license for both reading and writing .xlsx files from C/C++.
请查看XLSX I/O,这是一个在 MIT 许可下发布的 C 库,用于从 C/C++ 读取和写入 .xlsx 文件。
It's cross platform and specifically designed to allow streaming a lot of data to and from .xslx files with low memory footprint.
它是跨平台的,专门设计用于允许以低内存占用将大量数据传入和传出 .xslx 文件。
Only depends on expat and libzip. Tested on Windows (MinGW), Linux and OS X.
仅依赖于 expat 和 libzip。在 Windows (MinGW)、Linux 和 OS X 上测试。