Read data from Excel file in Objective-C (iPhone) [closed]

I’ve searched in google but I don’t seem to find a way to read Excel files from Objective-C. The only answers I find are to first convert to CSV and then read as a text file, but I don’t want that.

I know there must be a way, while I used many times the PHP modules to read/write Excel files, so I’m supposing there’s also a C library to do that (which then could be used in Objective-C/iPhone app)

So … does anyone know of such a library I could use on the iPhone?

How to import data from excel sheet in iphone programatically [duplicate]

This question already has an answer here: Read data from Excel file in Objective-C (iPhone) [closed] 5 answers I am working for a iphone project whose data source is an excel sheet.So now i am

Read Excel File Data From HttpPostedFileBase object

Uploaded Excel file Is In HttpPostedFileBase object HttpPostedFileBase hpf = Request.Files[ExcelFileeUploader]; Want To Read Excel Data From This Object. thanks.

C# read data from excel file results in ###

i read data from an excel file with this code Microsoft.Office.Interop.Excel.Worksheet xlWorkSheet; Microsoft.Office.Interop.Excel.Range range; int rCnt = 0; int cCnt = 0; string[,] data; xlWorkSheet

Read data from excel file

I have searched through StackOverflow, but didn’t find a clear answer to my question. I have a simple 2 columns and 24 rows xlsx (excel) file (later on this file will have more columns and rows , and

Read data from excel file in c# [duplicate]

Possible Duplicate: Reading Excel files from C# I’m searching some easy way to read data from excel file. How can I read data from ex. cell 4A? Is it possible? Or I must read dataRow? (If yes, how?)

Read closed csv file from excel 2000 vba

I am using excel-vba to access a closed .csv file created by another program. The code below just goes through each cell and copies the value from the closed excel file to same cell in the open work

Read data from Excel

I have been trying to read data from an excel file. It has been successful, but I enountered a problem. Whenever the format of the cell and the data entered in the cell is not matching then I get empt

can not read last column data from excel file

I am reading data from Excel file for the salary generation in that column is empcode, emp_name,working_days,overtime_hour when reading data from excel file i am read only first three column means i a

How to read data from password protected excel file with informatica

Pl help me to read data from a password protected excel file with informatica Basically i need to convert excel to csv and read with informatica Thanks

all data is not being read from excel file

I am using the code below to read data from a excel sheet and add the data into a data sheet but when reading the file and inspecting the data in the data-table some of the data is missing.. I have be

Answers

I think the PHP libraries use the Office OpenXML formats… The best library for reading/writing binary Excel files ( without running Excel itself and calling it via COM ) I’ve used is Apache POI – http://poi.apache.org/, but this is Java. You could attempt to use GCJ to get that working on the iPhone, but who knows what Apple would make of it. You could manually port the whole thing to Obj-C/ C++ I guess…

There are a few C / C++ libraries that do a limited subset, but they probably are not incredibly reliable or simple to use.

http://xlslib.sourceforge.net/index.php – LGPL

http://www.libxl.com/ – Commercial, $199, who knows if they would give you source for that to compile into your app.

http://www.codeproject.com/KB/office/ExcelFormat.aspx – C++ source, incredibly unclear licence like everything on code project. Who knows.

Another option is to attempt to extract the code from an open source excel reading competitor. Open Office – http://www.openoffice.org/ – is likely to be a complete nightmare, Gnumeric is probably a better bet. Excel code is here – http://git.gnome.org/browse/gnumeric/tree/plugins/excel – its likely to need a lot of messing about to make it work outside Gnumeric. KSpread has similar code here : http://websvn.kde.org/trunk/koffice/filters/kspread/excel/import/ , but I believe Gnumeric has a better reputation for accuracy wrt to Excel import.

Actually, there is such a project – its called libxls on source forge. There is a ObjectiveC class interface to the project as well. With this project you can open an excel file, and read most of the information in it (cell values as well as the file’s properties).

In addition there is an iOS Objective C interface to the library.

@David H
I find his answer is the best to solve the problem. You will find his DHlibxls is better to analyzing the xls file in the ios program. Here is in my blog‘s summary

I recently got into a project where the client wanted to import information from an Excel file into an app. I know a lot of people say, just transform it into a CSV and parse it that way, but I really didn’t want the client to go through yet another step and introduce a different file format – as simple as that may be.

I tried using DHlibxls, but I felt it was a little bit too complicated, so I created QZXLSReader. It’s a drag-and-drop solution so it’s a lot easier to use. I don’t think it’s as feature complete, but it worked for me.

It’s basically a library that can open XLS files and parse them into Obj-C classes. Once you have the classes, it’s very easy to send them to Core Data or a dictionary or what have you.

I hope it helps!

Other way, some where use libxls.

any way, more choose:

https://github.com/QuetzalMX/QuetzalXLSReader