# Uncompress files
Uncompress file is one of the actions under the File tools by Workato application. It allows you to uncompress .zip or .tar.gz or .gz files. The source files can come from any app (for example, Amazon S3, Dropbox, Salesforce).
# Input fields
|Compression format||Choose format for uncompression. Zip for .zip files and Gzip for .gzip and .tar.gzip files.|
|Archive format||Choose archive format for uncompressing. None for .gzip files and Tar for .tar.gzip files.|
|File contents||The source file to uncompress.|
# Output fields
|File list||File name||File name|
|File contents||File contents|
|File size||File size in bytes|
|File directory||Directory of the file inside the compressed file. Files stored in the root folder have a value of |
# Example: Uncompress a zip file
In this section, we will go through one example of how to uncompress a zip file and extract its contents.
We will use Amazon S3 as the file source for this example. However, you can use this same method with any other apps like Box, Dropbox, Google Drive, Salesforce, etc.
Uncompress file from S3. Sample recipe here (opens new window)
Let's go through the recipe step by step:
The recipe triggers whenever there is a New file added in an Amazon S3 bucket. We will process only the zip files in this recipe by setting the trigger condition.
We download the zip file into Workato.
We pass the file contents to the
Uncompress fileaction to extract its contents.
To process every file in the zip that we have just uncompressed, we use the For each action with the output file list from the
We use an If Condition to only process extracted files with the .csv file extension.
We parse the contents in the CSV files which contains expense reports.
The expense reports from the CSV file are then upserted into Netsuite in bulk.
Steps 5 - 7 repeats until all the CSV files from the zip file that we downloaded from Amazon S3 has been processed.
Last updated: 11/23/2023, 12:57:02 AM