Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I need help about this case....
I've imported data from xml file, did some calculations and now i want to store data in JSON file in structure like this:
{
"type": "FeatureCollection",
"crs": {
"type": "name",
"properties": {
"name": "urngc:def:crs
GC:1.3:CRS84"
}
},
"features": [
{
"type": "Feature",
"properties": {
"city": "Bratislava - Staré Mesto",
"county": "Bratislava I",
"region": "Bratislavský",
"latitude": 48.140589,
"longitude": 17.112327
},
"geometry": {
"type": "Point",
"coordinates": [
17.112327,
48.140589
]
}
},
----------------------------------------------------------------------------------------------
This is what i get:
----------------------------------------------------------------------------------------------
[
{
"type3": null,
"type2": null,
"city": "{\"type\":\"FeatureCollection\",\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"urngc:def:crs
GC:1.3:CRS84\"}},\"features\":{\"type\":\"Feature\",\"properties\":{\"city\":\"Praha\",\"county\":[],\"region\":\"Hlavní město Praha\",\"latitude\":\"50.08455284219091\",\"longitude\":\"14.417782158070091\"},\"geometry\":{\"type\":\"Point\",\"coordinates\":[\"50.08455284219091\",\"14.417782158070091\"]}}}",
"latitude": null,
"name": null,
"county": null,
"region": null,
"type": null,
"type1": null,
"longitude": null
},
I don't need these columns with null and I don't know how to get rid of them.
This is what i have in tWriteJSONFile:
I
This is my job:
And this is my output file and i think that here is the problem,but just don't know how to resolve it.
if you have any idea i would be more than grateful.
BR,
Tanja
Hello,
Please try to replace null with another data or handle the string further after tWriteJSONFile.
Maybe you could add a tJavaRow after tWriteJSONField and do this: output_row.output = input_row.output.replaceAll(",\"*\":\\", "");
Let us know if it helps.
Best regards
Sabrina