Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a csv file with one culonne "hotelId".
I want to create a json file with those IDs.
the json file must be like this one :
{
"unicaIds"
: [
15796781
,
16566288
]
}
How can i do this with talend ...any help please!
Hi @hiba chaieb
I use tDenormalize to put the hotel id into a list separated by a comma
then in the tWriteJsonField i select remove root node and add a sub element named unicalds when i drag and drop hotelId on it I select Add linker to target node
I right click on it and select as loop element , then I add it an attribute named class and I right click on it and select set a static value and I set it to array
finally I use a treplace to remove double quote after [ and before ].
Send me Love and Kudos
I use a tfixedflowinput to simulate your dataset
Hi @hiba chaieb
I use tDenormalize to put the hotel id into a list separated by a comma
then in the tWriteJsonField i select remove root node and add a sub element named unicalds when i drag and drop hotelId on it I select Add linker to target node
I right click on it and select as loop element , then I add it an attribute named class and I right click on it and select set a static value and I set it to array
finally I use a treplace to remove double quote after [ and before ].
Send me Love and Kudos