Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Unzip a file containing multiple files in cloud storage in place

I have a .gz file in a bucket in cloud storage.  The compressed file contains multiple other files.  I would like to un-compress the file in cloud storage without downloading it first to any kind of local storage.  I know this can be done in Dataflow using the Bulk Decompress Cloud Storage Files template, however this only works if the compressed file is a single file.

0 2 357
2 REPLIES 2

Hi, @joe_pc.

Mostly you can use Google Cloud functions to decompress a .gz file containing multiple files in Cloud Storage without downloading it to local storage. Create a Cloud Function that triggers on file upload to a specific Cloud Storage bucket. The function will:

  • Fetch the .gz file.
  • Decompress the contents.
  • Write the decompressed files back to Cloud Storage.

Regards,
Mokit

Thanks, Will give it a try.