将核心数据信息导出到 Excel 工作表
我想要一个 iPhone 应用程序,用户可以将应用程序保存的数据导出到 Excel 电子表格(以及许多其他格式)。
因此,我们的想法是,每个实体都是工作表中的一个新行,属性是不同的列。
这可能吗?
I want to have an iPhone app where the user can export the data held by the application to an Excel spreadsheet (as well as a host of other formats).
So the idea is that each entity would be a new row in the sheet, with the attributes being different columns.
Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Excel 和类似程序可以导入分隔文本格式的文件,例如 CSV。
绝对可以将 Core Data 属性操作为字符串,然后使用您描述的策略将它们以这种格式组合:实体的实例是行,属性是列。
注意:对于要导出的每个实体,您需要一个不同的文件。
您需要对实体之间的关系做任何事情吗?
您有具体的担忧吗?
Excel and similar programs can import files that are in a delimited text format such as CSV.
It is definitely possible to manipulate Core Data attributes into strings and then combine them in such a format using the strategy that you describe: instances of an entity are rows and attributes are columns.
Note: you would need a different file for each entity that you wanted to export.
Do you need to do anything with the relationships between entities?
Did you have a specific concern?