什么是与Excel文件的工作简单而可靠的C库? [英] What is a simple and reliable C library for working with Excel files?

查看:95
本文介绍了什么是与Excel文件的工作简单而可靠的C库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗯......就是这样。

Well... that's it.

我需要的东西的简单可靠(不必有花哨的功能 - 我需要写入和读取Excel单元格的文字和数字)

I need something simple and reliable (doesn't have to have fancy features - I need to write and read text and numbers from Excel cells)

是的,我想一个样本的Hello细胞code ...

And yes, I would like a sample "Hello Cell" code...

你有什么建议?

推荐答案

强烈反对。我建议你​​使用的是C-友好的格式(如CSV的),而不是XLS,或使用新的 XML 格式(以XML和ZIP库供您选择)。

Strongly discouraged. I'd recommend using a C-friendly format (e.g. CSVs) instead of XLS, or using the new XML formats (take your pick on XML and ZIP libraries).

尽管如此,速战速决,你可以导出为CSV报价,然后导入使用<一个href=\"http://www.activexperts.com/activmonitor/windowsmanagement/scripts/msoffice/excel/\">VBScript.像,但我会设法得到它在VBA工作第一位。

Still, for a quick fix, you could export to quoted CSV and then import using VBScript. Something like this, although I'd try to get it to work in VBA first.

请注意,这将需要Office的副本,并不会很好地扩展(但是你的 的可以隐藏Excel窗口)。

Note that this will require a copy of Office, and will not scale well (but you can hide the Excel window).


我刚刚发现 xlsLib 的,所以如果你真的需要直接用C写的,给它一个去!不过要小心,因为它很难得到正确,特别是如果你正在写到已经存在的文件。

I've just found xlsLib, so if you really need to write directly in C, give it a go! Be careful though, because it's very hard to get right, especially if you're writing to already-existing files.

此外,还存在 LibExcel 的,但是这是C ++,所以你需要编译周围的包装,或重写C.

There also exists LibExcel, but that's C++, so you'd need to compile a wrapper around, or rewrite for C.


最后一个警告:我没有在开始搜索这些原因是,这是非常难以得到的权利。我还没有使用的库上面的,但我怀疑他们会在陌生和不寻常的方式打破。我相信你读过乔尔的采取的Office格式。

One final caveat: the reason I didn't search for these at the start is that it's extremely difficult to get right. I have not used the libraries above, but I suspect they'll break in strange and unusual ways. I trust you've read Joel's take on the Office formats.

这篇关于什么是与Excel文件的工作简单而可靠的C库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆