Skip to main content

Fetch a Zip Archive and Scan Extract

ZIP archives can be remotely fetched via the api command for entry metadata scanning and extraction/conversion to datasets.

Specific file entries can be extracted and automatically serialized into datasets.

Let's take a look at an example.


Full Query

api get
|| api get --unzip.path $path$

Stage 1: Open and scan a Zip file entries

api get

The first stage will scan a Zip file and return a list of internal file entries metadata. Metadata includes specific information about each file found in a Zip archive including its name, path, size and other goodies. The Zip file metadata does not include the decompressed content.

Stage 2: Extract and convert files into a merged dataset

|| api get --unzip.path $path$

With our list of zip file entries, we will use the api command with a $path$ token to pluck the item value from each row. The $path$ token will be used to construct the --unzip.path value that will automatically extract and serialize the specified file contents into a dataset.

NOTE: The automagic serialization of the contents of a file into a dataset is derived from it's file extension.