Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have below data in CSV file.
studentid,studentname,studentcity,studentmarks,studentcountry
1,john,blore,34,india
2,ham,blore,98,india
3,james,blore,93,india
I am able to transform above CSV to single JSON file using tFileOutputJSON.
How to convert data from each row of single CSV file to multiple JSON files using Talend. For the above data, for each row, a JSON file should be created.
Thanks in advance.
Hi there,
I think you can solve your problem by reading the CSV file and then connecting the component tFileInputDelimited to tFlowToIterate. For each record, you will then generate a JSON file with tFileOutputJSON.
In order not to overwrite the JSON files, you can choose to add the current Datetime to its name and may use the name of the student to use in the file name as well.
Something like this: StudentName_CurrentDateTime.json
Something like this (in this case, the CSV has only NAME and SURNAME):
The JSON file names will be something like this:
i.e. Assuming one of the records has as name "Rui" and as surname "Motta", the JSON file path and name will be "C:/Users/Rui/workspace/Rui_Motta.json"