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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Use of Talend Data Mapper

Hi, I have a usecase where I have to convert csv data to JSON, please see below the problem :
field1;field2;field3
1;;3

The expected result is :
{
"element":
}

I honestly have absolutely no idea how to answer that need, seems like something the TDM would do quite easily, but don't know how.
If you have any question about that feel free to ask.
Thank you very much for your help,
PS: I'm running a version of Talend Studio for Cloud with Data Quality 6.0.1
Simon B
Labels (4)
5 Replies
Anonymous
Not applicable
Author

Sorry => I may have omitted to say that I cannot just normalize my input data because I have multiple cases of that on my file... A complete example would be
field1;field2;field3;value1;value2;value3;value4;tagList
1;;3;"hello";"world";"!";"!";"a,b,c,d"

And the result :
{
"element": ,
"value": ,
"tags":
}
Anonymous
Not applicable
Author

Hi,
Do you want to use tHap to convert csv data to JSON?
Here is a component TalendHelpCenter:tWriteJSONField which transforms the incoming data into JSON fields.
Please take a look at the related scenarios to learn how to use it.
Best regards
Sabrina
Anonymous
Not applicable
Author

Hi,
I knew about this component but I can't use it easily in that case because I have to split every part of my input schema (and generate a key for each line) then use one tWriteJsonField for each part of the input schema to create the different arrays, write those in a file, then join every file I created and join them and use a last tWriteJsonField to create my global Json file... It's a real pain, but apparently I had no choice... 

Hope that helps,
Simon B
0683p000009MCVv.png
Anonymous
Not applicable
Author

Hi Sonam, 
Does your input structure always fixed or it has variable schema? based on that we may suggest better. 
Anonymous
Not applicable
Author

Hi,
I don't know who Sonam is but on my side the input structure is dynamic, hence the use of a tExtractDynamicFields 0683p000009MACn.png
Thanks,