Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
amit_n
Contributor
Contributor

how to extract the json data which are in single string column and convert to separate columns?

Hi all,

 

I have urgent requirement. I have json file which are in single string line and having multiple columns . I need to separate the columns and their value in csv file. Attached the sample file please let me know how can i convert to json to csv file which are in single string value.

 

file is in txt format first convert the txt format to json format and try to convert the json data to csv file.

Labels (6)
1 Solution

Accepted Solutions
akumar2301
Specialist II
Specialist II

input component

 

0683p000009M35R.jpg

View solution in original post

4 Replies
akumar2301
Specialist II
Specialist II

you can use textractJsonfield

 

0683p000009M35H.jpg

you need to complete above schema.

 

Sample result

 

d66c6f9c-572f-e911-b8b3-0004ff9d738f|0f79fecc-e7c0-e811-a979-000d3af49c6c|2019-02-13T06:21:43Z|indskr_positiongroups
241e2b1f-572f-e911-b8b3-0004ff9d738f|0f79fecc-e7c0-e811-a979-000d3af49c6c|2019-02-13T06:18:05Z|indskr_positiongroups
d5200cd9-562f-e911-b8b3-0004ff9d738f|0f79fecc-e7c0-e811-a979-000d3af49c6c|2019-02-13T06:16:07Z|indskr_positiongroups
0e9e8390-562f-e911-b8b3-0004ff9d738f|0f79fecc-e7c0-e811-a979-000d3af49c6c|2019-02-13T06:14:05Z|indskr_positiongroups
b2d7fbaa-af2e-e911-b8b3-0004ff9d738f|0f79fecc-e7c0-e811-a979-000d3af49c6c|2019-02-12T10:19:33Z|indskr_positiongroups
d9b9056a-af2e-e911-b8b3-0004ff9d738f|0f79fecc-e7c0-e811-a979-000d3af49c6c|2019-02-12T10:17:35Z|indskr_positiongroups

amit_n
Contributor
Contributor
Author

please can you let me know which is that input component u have used. M using talend open studio. can u please attach the job.

 

M facing the below error.

 

net.minidev.json.parser.ParseException: Unexpected End Of File position 0: null
Expected to find an object with property ['AuditDataSet'] in path $ but found 'java.lang.String'. This is not a json object according to the JsonProvider: 'com.jayway.jsonpath.spi.json.JsonSmartJsonProvider'.
Expected to find an object with property ['AuditDataSet'] in path $ but found 'java.lang.String'. This is not a json object according to the JsonProvider: 'com.jayway.jsonpath.spi.json.JsonSmartJsonProvider'.
net.minidev.json.parser.ParseException: Unexpected character (}) at position 0.

akumar2301
Specialist II
Specialist II

input component

 

0683p000009M35R.jpg

amit_n
Contributor
Contributor
Author

thank you so much m able to extract the columns data.