Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
cd160
Contributor
Contributor

Issue in mapping json file with comment

I am trying to map data out of a JSON file. However, my file has comments at the beginning. If I remove them, job runs smoothly with no issues.

However, If I use the file as is with the comment, my log comes out blank.

 

The job design is quite simple:

tFileInputJSON->tLogRow

 

Eventually the main job is to map the JSON file columns into MongoDB (tFileInputJSON->tMap->tMongoDBOutput), but that was not a problem. Again, the job runs smoothly when I remove the comment at the beginning.

 

Below is how the file starts, including the comment at the beginning in RED.

Hopefully someone can advise.

 

Thanks!

 

[{
"_Disclaimer" : {
"disclaimer" : {
"sectionHeader" : "Disclaimer",
"line1" : "Line 1 content.",
"line2" : "Line 2 content",
"line3" : "Line 3 content"
},
"disclaimerOnDataProtection" : {
"sectionHeader" : "Disclaimer on Data Protection",
"line1" : "Line 1 content.",
"line2" : "Line 2 content",
"line3" : "Line 3 content",
"line4" : "Line 4 content"
},
"registerDownload" : {
"sectionHeader" : "Register Download",
"line1" : "Line 1 content",
"line2" : "Line 2 content"
}
}
}],

[{
"OwnerID" : "data 1",
"EntityCode" : "data 2",
"EntityType" : "data 3",
"Services" : [{
"Service 1" : ["data 1", "data 2", "data 3"]
}],
"Properties" : [{
"Property 1" : "data 1"
}, {
"Property 2" : "data2"
}],
"__EBA_EntityVersion" : "20190807152443537"
}]

Labels (3)
1 Reply
Anonymous
Not applicable

Hi
If the file always has the same number of lines, you can use tSampleRow to remove the comments and create a new file before extracting JSON data, eg:
tfileinputFullRow--main--tSampleRow--tFileOutputDelimited
|
onsubjobok
|tFileInputJSON->tMap->tMongoDBOutput

 

on tSampleRow: set the Range as: ""23..36""

Regards
Shong