> For the complete documentation index, see [llms.txt](https://olddocs.exivity.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://olddocs.exivity.io/2.3.1/diving-deeper/extract/language/gunzip.md).

# gunzip

{% hint style="danger" %}
The functionality described in this article is not yet available. This notice will be removed when   the appropriate release is made.
{% endhint %}

The `gunzip` statement is used to inflate a GZIP file

## Syntax

**`gunzip`** *`filename`* **`as`** *`filename`*

**`gunzip`** *`{bufferName}`* **`as`** *`filename`*

## Details

The `gunzip` statement can be used to extract the contents of a GZIP archive containing a single file. The GZIP archive may be a file on disk or may be the contents of a named buffer.&#x20;

It is not possible to inflate GZIP data directly in memory, but the same effect can be achieved by extracting GZIP data in a named buffer to disk, and then loading the extracted data back into the named buffer as shown in the example below.

{% hint style="info" %}
All paths and filenames are treated as relative to the Exivity home directory
{% endhint %}

## Example

```
# Download an archive and extract it into a named buffer
buffer archivedata = http GET http://server/archived.csv.gz
gunzip {archivedata} as system/extracted/extracted.csv
buffer archivedata = FILE system/extracted/extracted.csv

# Download an archive and extract it to disk, automatically deriving the
# output filename from the input filename based on the .gz extension
var save_path = system/extracted
var archivefile = extracted.csv.gz
set http save_file ${save_path}/${archivefile}

match csv_name "(.*)\.gz$" ${filename}
if (${csv_name.STATUS} != MATCH) {
    print WARNING: Downloaded file does not end in .gz and will not be extracted
} else {
	gunzip "${save_path}/${archivefile}" as "${save_path}/${csv_name.RESULT}"
	print Extracted file: "${save_path}/${csv_name.RESULT}"
}

```
