โ03-02-2023 03:42 PM
Hello All,
I have file called โfilename.json.gzโ which is obtained using REST GET Snap and I need to convert it to a CSV format file. I need this transformation to be done in one pipeline.
Any help would be greatly appreciated. Thanks!!
Solved! Go to Solution.
โ03-03-2023 10:34 AM
GZip stuff is a little bit more work, but itโs possible here, youโll want to set the REST Get Response Entity Type to BINARY
With that, youโll then have to map the data from the output document to content for a document to binary transition, to do this, youโll want to map the settings in the mapper (some of these are optional, but Iโd say content-type
, content-encoding
, and content
are all required on the output map)
With that, you can use the Document to Binary to get it in a binary form (I set the drop-down for Encode or Decode to NONE), then decompress (you select GZip), then you can parse the JSON with the JSON Parser.
Full pipeline screenshot
download (youโll need to change the URL to download in the REST Get)
json gzip_2023_03_03.slp (8.0 KB)
โ03-03-2023 06:06 AM
Hi @deepthi.chidi.
You can try by splitting the entity from the Rest Get Response and then using CSV Formatter.
Let me know if this helps you.
BR,
Aleksandar.
โ03-03-2023 10:18 AM
Hello Aleksandar,
I did try but it didnโt work.
Here is how my REST SNAP output looks like and I need to read data thatโs in filename="Test_2023_02_10.json.gz\
[{โstatusLineโ:{โprotoVersionโ:โHTTP/1.1โ,โstatusCodeโ:200,โreasonPhraseโ:โOKโ},โentityโ:โabcdโ,
โheadersโ:{โvaryโ:โAccept-Encodingโ,โx-powered-byโ:โ153.1โ,โx-accepted-oauth-scopesโ:โanalytics:readโ,โtransfer-encodingโ:โchunkedโ,โpragmaโ:โprivateโ,โviaโ:โenvoy, envoyozakโ,โdateโ:โFri, 03 Mar 2023 GMTโ,โx-oauth-scopesโ:โidentify.analytics:readโ,โcontent-dispositionโ:โattachment; filename="Test_2023_02_10.json.gz"; filename*=utf-8โ'Test%202023-02-10.json.gzโ,โaccess-control-allow-headersโ:โhyyuyโ}}]
Thank you !
โ03-03-2023 10:34 AM
GZip stuff is a little bit more work, but itโs possible here, youโll want to set the REST Get Response Entity Type to BINARY
With that, youโll then have to map the data from the output document to content for a document to binary transition, to do this, youโll want to map the settings in the mapper (some of these are optional, but Iโd say content-type
, content-encoding
, and content
are all required on the output map)
With that, you can use the Document to Binary to get it in a binary form (I set the drop-down for Encode or Decode to NONE), then decompress (you select GZip), then you can parse the JSON with the JSON Parser.
Full pipeline screenshot
download (youโll need to change the URL to download in the REST Get)
json gzip_2023_03_03.slp (8.0 KB)
โ03-03-2023 12:01 PM
Thank you, it worked.