Alteryx Designer Cloud Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Cloud.
SOLVED

How do I restructure JSON files ?

In the docs it states that the JSON input data has to have one JSON object per line. ( https://cloud.google.com/dataprep/docs/html/Supported-File-Formats_57344528 )

Suffice to say that a lot of JSON data is pretty formatted for better readability. But this in turn seems to mess up Dataprep parsing.

Is there a way to reformat JSON into the ideal format with "one valid JSON object per line" ?

2 REPLIES 2
Trifacta_Alumni
Alteryx Alumni (Retired)

You could use JQ ( https://stedolan.github.io/jq/ ) to reformat your JSON

You can give it a try via JQ Play ( https://jqplay.org/# ) and use the "compact output" option, which will result in exactly one object per line. JQ Play will also provide you with the exactly needed JQ command-line to use on your greater data set

 

That's awesome, thanks for the tip