简体   繁体   中英

flat file mapping to json

I have a flat file in below format:

value1|value2|Value5|...|ValueN

I would like to match those values using json schema name.

Example Schema

{
object : { "name1:Value1",
"name2:Value2",
"name3:Value3",
.
.
},object : { "name1:Value1",
"name2:Value2",
"name3:Value3",
.
.
},

how to map those flat file values to json schema.

JSONObject jobj1=new JSONObject();
JSONObject jobj2=new JSONObject();
JSONObject jobj3=new JSONObject();

jobj2.put("v1":"a");
jobj2.put("v2":"b");

jobj3.put("v3":"a");
jobj3.put("v4":"b");

obj1.put("object1":jobj2);
obj1.put("object1":jobj3);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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