简体   繁体   English

iOS轻松转换和存储大表的方法

[英]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. 我有表~100x100的Excel文件,需要从iOS应用程序访问这些值。 在此输入图像描述

At first, I've try to make json in Mr.DataConverter and then it's not a problem to read to array. 首先,我尝试在Mr.DataConverter中创建json,然后读取数组不是问题。 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. 所以,从这一刻起,我无法将我的Json字符串解析为NSArray。

The question is: How to convert xls to json, OR How to put and retrieve the values in iOS device? 问题是:如何将xls转换为json,或者如何在iOS设备中放置和检索值?

Thanks. 谢谢。

You can use the DHlibxls iOS Framework and simply pull the .xls file into your app, then read and process with that framework. 您可以使用DHlibxls iOS Framework ,只需将.xls文件拉入您的应用程序,然后使用该框架进行读取和处理。 The framework is based on the open source libxls library on SourceForge, and has a non-attributed BSD license. 该框架基于SourceForge上的开源libxls库,并具有非属性BSD许可证。

Alternative: If possible use excel file in formate: tab delimited-text-file. 备选方案:如果可能,请在formate:tab delimited-text-file中使用excel文件。 That solve all your problem. 这解决了你所有的问题。 Easy to open text file in iOS with file manager/c++. 使用文件管理器/ c ++在iOS中轻松打开文本文件。

convert-an-excel-spreadsheet-to-a-tab-delimited-text-file 转换-AN-Excel的电子表格到A-制表符分隔文本文件

I recommend exporting the Excel spreadsheet to CSV and then using a proper CSV parser to parse the data. 我建议 Excel电子表格导出为CSV,然后使用适当的CSV解析器来解析数据。 If you run into any issues then there is likely an issue in the spreadsheet that you would need to fix. 如果您遇到任何问题,那么电子表格中可能存在您需要修复的问题。

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

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