How to import Excel sheet data into my iphone App.

倾然丶 夕夏残阳落幕 提交于 2019-12-04 12:33:07

There is an open source C library on Source Forge called libxls that you can use to read a .xls file (the older non-XML format). In addition to that, there is a ObjectiveC framework that wraps the C library called DHlibxls. The library will let you read both string and numeric values. The library is quite mature and stable.

Excel, like PDF and others, is a bloated format that comes in different flavors that have been added on over its lifetime which spans more then a decade. That is why people urge you to use CSV, because Excel is ridiculous and unwieldy. The documentation of the format is 250 pages long.

For XLS (2003 and before) you could consider this library (though I've never used it): http://libxls.sourceforge.net

However, in my own workflow (in which I have control over the format of data sent to me) I have the authors make TSV (tab separated value) files. You can just copy and paste your Excel cells into a text editor to make one. Then it is easy to parse, assuming none of the cells contain a tab character. You could also go the scripting route. Roo is a fine gem for Ruby that can handle several kinds of open office and microsoft formats. If you don't have this kind of control though, then you either have to write you own parser (I'd rather quit my job) or find one written in C or Objective-C.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!