Can I create a .xls file programmatically in iOS? - ios

I need to create a .xls file from the Array data programmatically in iPhone. How can this be done?

Maybe you're in trouble, maybe not. The "old" xls format is a binary one and I am not aware of any free libraries which are able to read or write to that format. If this one is required, you're propably out of luck.
If however a more recent format will do you're back in business, because you can use xml (objc wrappers for lib2xml are readily available). Wikipedia features a short overwiev of the format which you might want to check out: Excel file formats on Wikipedia

Related

detect encoding of xlsx content in ruby

I have an app which allows uploading spreadsheets in xls, xlsx and csv format. The data is later used at various client facing places. The people managing the data use various tools to create the spreadsheets, including mac/excel, win/excel, win/openoffice, linux/libreoffice...
The real problem is the mac/excel encoding, which creates some nasty looking strings. Is there any way to make sure the file content's encoding is valid utf-8?
My approach of just File.read(file.path).valid_encoding? checking works only for csv...
I would look into charlock_holmes, a gem which lets you easily detect and even attempt to transcode files based on their encoding.

Any feasible solution to read/write simple XLS file on IOS?(I just need plain text)

I found some questions similar to this question was asked but no one provide a decent solution.
I've found two projects on sourceforge (libxls and xlslib) to read/write XLS, but they are under GNU license which I think can not be used in IOS app.
I don't want a full function read/write XLS lib. I just need to write some plain text in several rows and columns.Pretty like just the XLS version of CSV.(CSV is all i need but for some reason i need XLS file format. I can manually read/write CSV format because it's really easy to understand. But XLS is way too complicated...XLS format's documentation is like hundreds of pages...I really don't want to deal with like file headers and something like that)
Is there any solution? Or is there any way to easily convert a CSV file to XLS in IOS?

What's the best approach for modifying PDF interactive form fields on iOS?

I've been doing some head banging on this one and solicit your advice.
I am building an app that as part of it's features is to present PDF forms; meaning display them, allow fields to be changed and save the modified PDF file back out. UIWebViews do not support PDF interactive forms.
Using the CGPDF apis (and benefit from other questions posted here and elsewhere), I can certainly present the PDF (without the form fields/widgets), scan and find the fields in the document, figure out where on the screen to draw something and make them interactive.
What I can't seem to figure out is how to change the CGPDFDictionary objects and write them back out to a file. One could use the CGPDF Apis to create a new PDF document from whole cloth, but how do you use it to modify an existing file?
Should I be looking elsewhere such as 3rd party PDF libs like PoDoFo or libHaru?
I'd love to hear from anyone who has successfully modified a PDF and written it back out as to your approach.
I once did this incredibly cheaply by munging through the PDF -- I mean using regular expressions -- and just dirtily changing the actual raw text of the raw PDF data file.
It can work perfectly in simple situations where you are easily able to find the value in question.
No idea what you're trying to do here but a lateral thought! Hope it helps!

Binary Serialized File - Delphi

I am trying to deserialize an old file format that was serialized in Delphi, it uses binary seralization. I know nothing about the structure of the file except some very high level records that are in it.
What steps would you take to solve this problem? Any tools etc?
A good hexeditor, and use the gray matter to identify structures.
If you get a hint what kind of file it is, you can search for more specialized tools.
Running the unix/Linux "file" command can be good too (*) See Barry's comment below for how it works. It can be a quick check for common filetypes like DBF,ZIP etc hidden by using a different extension.
(*) there are 3rd party builds for windows, but they might lag in versions. If you can do it on a recent *nix distro, it is advised to do so.
The serialization process simply loops over all published properties and streams their value to a text file. If you do not know the exact classes that were streamed to the file you will have a very hard time deserializing the file. (if not impossible)
A good hex editor is first. If the file is read without buffering (eg read directly from a TFileStream) you could gain some information when using ProcMon from SysInternals; You can see exactly what data is read in what chunks and thus determine more quickly where the boundaries are between the structures you already identified.

Changing EDI files by opening in XLS

I have a EDI file ...i want to test it ....so when I open it it opens in an EXCEL file,....there is some data I want to change....
BGS~EGI~PG~265\TIA~5008~~~16796~GA\BGS~EGI~PG~360\TIA~5008~~~22827~GA\BGS~EGI~PG~528\TIA~5008~~~18304~GA\
TO
BGS~EGI~PG~265\TIA~5008~~~0~GA\BGS~EGI~PG~360\TIA~5008~~~0~GA\BGS~EGI~PG~528\TIA~5008~~~0~GA\
Can it be done on EXCEL and the changes reflect in the EDI sheet?If do that in EXCEL and save ....how to save it?I did that but did not know which format to Save....xlt/xls/ etc. I save it as .xlt format.Is that the correct way?
Further the cursers just goes hay way when i click on a cell. How to control the cell?
pLEASE HELP
ATorras is on the right path. EDI is sort of a text format. I'd call it more of a binary format. (There's also XML EDI, but that's not what you're dealing with here.)
Depending on the size of the file, you may run into line limits in some editors. Others may be adding line breaks that may or may not cause issues with some EDI translators.
You can have EDI files with binary delimiters (such as segment terminators). This is not common, and it doesn't look like the case with your test data.
The file extension only matters to the translator or other software that's trying to find/send the EDI file. Basically you don't want to change the original extension.
I don't remember what the standards are for Unicode, etc., so that may be a concern in some cases. You'll want to preserve whatever encoding the original file uses.
Short version: Most of the time you can get away with using Notepad, vi, etc. Sometimes you can't. If you have access to dedicated EDI tools for parsing/editing/translating, use those. Never use Excel or Word. Always make a backup of your original first. Verify that your trading partner is getting what you expect.

Resources