2

I am using Talend Studio for data integration to process data. The data are stored in xml file, then are converted to JSON file. One of columns (partners) is a String element delimited by ";" separator.

example : "partner1;partner2;partner3"

expected result : ["partner1","partner2","partner3"]

Is there any Talend functon to do this? or can I use java functions ?

1
  • Could you please explain in detail, what exactly you have done so far and the issue you are facing currently Commented Aug 16, 2020 at 14:28

1 Answer 1

1

Working with Json data in Talend is quite complicated. You can achieve what you want with Talend components, but workflow is not so simple.

enter image description here

  1. tFileInputXML : extract data from your xml
  2. tNormalize : normalize the column where you have multiple occurences (here I used ";" as a separator). Number of rows in the output is the number of element in your column (in your example : 3)
  3. tMap : I mapped my column, and added a fixed field "loop" for the next component enter image description here
  4. tWriteJsonField : here you have to use attributes and loops to get an array. see screenshot. enter image description here enter image description here

Your question is quite simple, but the resolution is not. If someone has a better way to do it, I am curious to see it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.