sam
sam

Reputation: 873

Downloaded csv.gzip from S3 bucket and it's in hieroglyphs (encoding error)

aws s3 cp s3://bucketname/path/to/file/filename.csv.gz . --content-encoding gzip

I'm just trying to download a compressed csv file from a bucket that we don't control but have permissions to. I ran the above and the file downloads but is not viable. The result is in the picture below.

How can I download a viable file?

enter image description here

Upvotes: 3

Views: 1598

Answers (2)

CRV
CRV

Reputation: 69

You can download the file as it is. It will be download as a csv file but with a compressed content. So, you can rename the file as a gz file and then decompress it. That will solve the problem.

If you are using terminal commands and the downloaded file name is x.csv

  1. mv x.csv x.gz
  2. gzip -d x.gz

Upvotes: 0

Chris Williams
Chris Williams

Reputation: 35178

The object in question still needs to be decompressed.

Try performing the following command instead aws s3 cp s3://bucketname/path/to/file/filename.csv.gz ---content-encoding gzip | gzip -d to automatically decompress it on the way out

Upvotes: 1

Related Questions