简体   繁体   English

如何使用IOS库将xls转换为csv?

[英]how to convert xls to csv using IOS library?

I need to read xls files in my IOS app. 我需要在IOS应用中读取xls文件。 First of all, I want to convert xls files to csv format files, then my app parse csv files, but I can't find any ios library to convert xls to csv, please help me 首先,我想将xls文件转换为csv格式的文件,然后我的应用程序解析csv文件,但是我找不到任何ios库将xls转换为csv,请帮助我

If you have a .xls file, you can use the open source DHlibxls library to read the file into your app. 如果您具有.xls文件,则可以使用开源DHlibxls库将文件读入您​​的应用程序。 This is an ObjectiveC framework that wraps a C-based library. 这是一个基于C的库的ObjectiveC框架。 The library is quite mature. 图书馆已经很成熟了。

ios or any objecive-framework doesn't provide any thing for accesseing Microsoft's xls :( ios或任何objecive-framework都不提供访问Microsoft xls的任何功能:(

To convert-xls to/fro csv is itself a project in it!!! 将xls转换为csv本身就是其中的一个项目!!!

On top of this, there are different format of xls, now xlsx files. 最重要的是,现在有xlsx文件的不同格式。 And writing a xls and reading it back in proper way is tooooo-cumbursome task to accomplish. 编写xls并以适当的方式将其读回是一项繁重的任务。 However we have managed to read it but it is not 100% efficient :( 但是我们已经设法阅读了它,但是效率不是100%:(

I guess in near future you may want to move to xlsx file then your task will be a lot more difficult. 我想在不久的将来您可能想移到xlsx文件,那么您的任务将更加困难。 You can check yourself, change the file name extension to .zip and unzip you will see many files, one having row numbers, another columns, third with links, fourth with contents and so on. 您可以检查自己,将文件扩展名更改为.zip并解压缩,您将看到许多文件,一个文件具有行号,另一列,第三具有链接,第四具有内容,依此类推。 Mapping and getting in correct form in not impossible but needs a lot of work. 映射并以正确的形式获取不是不可能的,但是需要大量的工作。

There can be many other ways to do, I can suggest to use java api to do, or even save you xls to csv directory from excel, then your work will be easy. 可以有许多其他方法,我建议使用java api来做,甚至可以将xls从excel保存到csv目录,这样您的工作将很容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM