Is there any way to parse Microsoft excel in iPhone? - iphone

I want to parse an excel sheet and have to display the content in table view. Suggestions please.

The easiest way is to save your excel file as a text file with tab delimiters. This way its straight forward. In case you like to do some "intelligent" parsing - you may just take a look at one of these many parser tutorials for the iPhone. I am sure, you will be able to build on these sample quite easily.

Related

Swift Convert a .numbers file or a xlsx to a csv file programmatically

For a project I'm working on I have a CSV reader to read user input. But that's quite an annoying UX, cause the user has the data in a google sheet/ execl (xlsx) format or numbers format. So if the user did not convert the file to CSV before uploading, they need to navigate to the Numbers app and export the file to file to CSV there.
So I was thinking how can I make this better, first thought, yeah just read the xlsx or numbers file ..... One day googling and trying some stuff, I still didn't find a good approach.
I would love to hear your input, I'm sure somebody out there has experience with this.
I'm thinking about creating an API for it. But I prefer to handle it natively in swift.
Thanks!

iOS easy way to convert and store large table

I have Excel file with table ~100x100 and need to get access to this values from iOS app.
At first, I've try to make json in Mr.DataConverter and then it's not a problem to read to array. But! Some float values didn't recognized properly, and I'd got numbers without quotes:
At the time other parsed correctly!
So, from this moment I can't parse my Json string to NSArray.
The question is:
How to convert xls to json, OR How to put and retrieve the values in iOS device?
Thanks.
You can use the DHlibxls iOS Framework and simply pull the .xls file into your app, then read and process with that framework. The framework is based on the open source libxls library on SourceForge, and has a non-attributed BSD license.
I recommend exporting the Excel spreadsheet to CSV and then using a proper CSV parser to parse the data. If you run into any issues then there is likely an issue in the spreadsheet that you would need to fix.
Alternative: If possible use excel file in formate: tab delimited-text-file. That solve all your problem. Easy to open text file in iOS with file manager/c++.
convert-an-excel-spreadsheet-to-a-tab-delimited-text-file

How to read pdf table content data?

I have a requirement to read a pdf file having tabular format data only like in excel file. I need to extract the cell value of given pdf file.
Is it be anyhow possible using itext API. If you have something to share then please share it or any other solutions?
The PDF format is just a canvas where text and graphics are placed without any structure information. As such there aren't any iText-objects in a PDF file. In each page there will probably be a number of Strings, but you can't reconstruct a phrase or a paragraph using these strings. There are probably a number of lines drawn, but you can't retrieve a Table-object based on these lines.
In short: parsing the content of a PDF-file is NOT POSSIBLE with iText.
You can try this! This lets you read PDF pages.
I recently ran into this problem. I wasn't able to make it work with itext.
An alternate solution I found was to open a PDF document in Adobe and export it to xml. At least with my PDF's it preserved the table information and then I was able to programmatically work with the XML to generate tabular files like excel etc.
The other issue I ran into was that Adobe only lets you export one file at a time and I had lots of files. Luckily Adobe also has a merge function. I ended up merging all the files together and then exporting them as one big XML file and working with that file to generate what I needed.

editing pdf contents in uiwebview iphone

hi im working on pdf manipulation.
my requirements are to edit the existing pdf document.
looks like there is no actual way to do it. i found out using javascript i can edit the html contents.
so now that my pdf is in uiwebview is there any way to convert pdf document to html content???
i have to do it programatically.
preferred language is objective c but its k if any suggestions in C/C++
thanks in advance
You will have to drop down to C if you want to do this. Basically you need to get hold of a CGPDFDocumentRef reference, and through that iterate each CGPDFPageRef. From the page you can get access to the CGPDFContentStreamRef.
From the content stream you can parse out the primitive data that is is PDF document. From there only a good understanding of the PDF document format can help you.
I would advice you to find a commercial tool, hire an experience contractor, or change your plan. What you have your sights on is allot of hard work.

Is there a way to embed an Excel chart inside an iOS app?

Is it possible for it to retain its display formatting, and links to Internet sites?
UIWebView can display Excell documents. Just open them like you would any other HTML file. Not sure about the display formatting or links though.
http://developer.apple.com/library/ios/#qa/qa1630/_index.html
My approach would be a little bit different. If you have a way to get to the displayed data (e.g. parse the excel file, or if possible use a csv or plist). Then you could use CorePlot to display the data. I really like this SDK, because you can nearly customize everything. ;-)
Sandro