Rest Get output is in filename.json.gz format need to convert to csv

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!!

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.


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\

“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”:“”,“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 !

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)

Thank you, it worked.

1 Like