Need to input json format file and convert into csv file
Hi,
I have file in the format of json.
Need to upload json file and need to convert and prepare data in csv format.
How I need to do that, can you guide me.
Answers
-
Manuel Alpha Tester, Dataiker Alumni, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Dataiku DSS Adv Designer, Registered Posts: 193 ✭✭✭✭✭✭✭
Hi Sushil,
After uploading the file with the json format, using a Prepare recipe and the Unnest processor to flatten the data into columns.
I hope this helps.
-
Hi, still not able to solve the problem.
Can you please guide me the some python code which can read json file as input and convert into csv file format as output.
Or any other way to convert the json file to readable csv format
-
Manuel Alpha Tester, Dataiker Alumni, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Dataiku DSS Adv Designer, Registered Posts: 193 ✭✭✭✭✭✭✭
Hi,
Are you able to upload your source file?
Does it create a dataset with one column and the data in json format?
You need this to do it in either Python or visually, but once you succeed with this, then you can simply use the unnest processor in a Prepare recipe.
I hope this helps
-
Hi,
- I can able to create dataset.
- How to use unest processor to prepare recipe.
- How to give input column .
-
Manuel Alpha Tester, Dataiker Alumni, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Dataiku DSS Adv Designer, Registered Posts: 193 ✭✭✭✭✭✭✭
Hi,
In a prepare recipe, do "add a new step", search for Unnest. There is a field to indicate the column with the json.
See the example attached.
Best regards
-
Hi,
I followed as per the screenshot
By using unnest process in recipe, still facing the error
The input column which given is not recognized.
Pls find attached the screenshot of the issue
-
Manuel Alpha Tester, Dataiker Alumni, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Dataiku DSS Adv Designer, Registered Posts: 193 ✭✭✭✭✭✭✭
Hi,
From the screenshot, I notice two things you need to do differently:
- Your rows seem to have different parts of the JSONs. When you upload the file, you need to adjust the settings in the format/preview tab (see attached) to ensure you end up with one json per row
- Your column is not called json. In the unnest processor you need to use the name of that first column. I can't really see in the screenshot, but when uploading the file, you can name the column anything you want in the schema tab.
Best regards
-
Hi, Thanks for an input and guidance. now it's works fine. I can able to get results
Thank you