json - Java data transformation library -
json - Java data transformation library -
throwing error jsonreader can not resolved type
how handle it??
public class flatten {
private static final string file = "employee.json"; public static void main(string[] args) throws throwable { datareader reader = new jsonreader(new file(file)) .addfield("empmid", "//empmid") .addfield("comments", "//comments") .addfield("col1", "//col1") .addfield("contactaddress", "//contact//address") .addfield("contactfreetext", "//contact//freetext") .addfield("gender", "//gender") .addrecordbreak("//employee/array/object"); datawriter author = new csvwriter(new outputstreamwriter(system.out)); jobtemplate.default.transfer(reader, writer); } }
do u need "common jars" task ? in opinion, trans json fmt info such list of 'employee' node csv need few lines of codes,
for emp in employee : write "emp.id, emp.name...." file write eol
maybe u wanna class "csvwriter", wrap code snippet upon in csvwriter. :-)
java json csv
Comments
Post a Comment