# unzip

The `unzip` statement is used to unzip the data in a [named buffer](/2.10.2/data-pipelines/extract/language/buffer.md).

## Syntax

**`unzip`***`{buffer_name}`*

## Details

The `unzip` statement will extract a single file from a zip archive stored in a named buffer. In order for this to succeed, the buffer must have been previously populated using the [buffer](/2.10.2/data-pipelines/extract/language/buffer.md) statement, and the data within the buffer must be a valid ZIP file.

{% hint style="warning" %}
Only ZIP files are supported. To extract GZIP files, use [gunzip](/2.10.2/data-pipelines/extract/language/gunzip.md)
{% endhint %}

A warning will be logged, the buffer left intact and the script will continue to execute if any of the following conditions arise:

* The buffer is empty or does not contain a valid ZIP archive
* The ZIP archive is damaged or otherwise corrupted
* More than 1 file is present within the archive

After the `unzip` statement completes, the buffer will contain the unzipped data (the original ZIP archive is discarded during this process).

The filename of the unpacked file is also discarded, as the resulting data is stored in the buffer and can subsequently be saved using an explicit filename as shown in the example below.

## Example

```
buffer zippedData = FILE system/extracted/my_source/${dataDate}_usage.zip
unzip {zippedData}
save {zippedData} as system/extracted/my_source/${dataDate}_usage.csv
discard {zippedData}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://olddocs.exivity.io/2.10.2/data-pipelines/extract/language/unzip.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
