简体   繁体   English

JSON对象展平为CSV一行

[英]JSON object flattening to CSV one row

Has anyone ever been involved with exporting JSON like this one in my sample made only for the purposes of this conversation: 在我的示例中,是否有人参与过像这样的JSON导出,仅出于本次对话的目的:

https://gist.github.com/slavisah/97b57a5826dc0b49ee22895035eb244a https://gist.github.com/slavisah/97b57a5826dc0b49ee22895035eb244a

It represents a list of material objects (wood, metal etc.) Requirement is that every material has to be written in one line of CSV file with all of it's behaviors and properties, and their sub-lists in relation to them in the same row. 它表示材料对象(木材,金属等)的列表。要求是必须将每种材料及其所有行为和属性写入一行CSV文件,并且在同一行中与它们相关的子列表。 Every list is N sized. 每个列表的大小均为N。

My question is how to structure that CSV file for easiest export/import in my application? 我的问题是如何在我的应用程序中构造该CSV文件以最简单地进行导出/导入? Maybe someone is familiar with Java library which is capable of doing things like this? 也许有人熟悉Java库,它能够完成这样的事情?

Thanks. 谢谢。

Some good libraries for working with csv files using java... 一些使用Java处理csv文件的良好库...

http://www.beanio.org/ http://www.beanio.org/

http://super-csv.github.io/super-csv/index.html http://super-csv.github.io/super-csv/index.html

我建议您使用Apache poi Microsoft文档的Java API: https//poi.apache.org/

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

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