LogoLogo
2.3.1
2.3.1
  • Introduction
  • Getting started
    • Installation
      • On-premises
      • Azure Market Place
      • AWS Market Place
    • Concepts
      • Datadate
      • Datasets
      • Program directory
      • Home directory
      • RDFs
      • Accounts
      • Services
    • Configuration
      • Data Sources
        • Extractors
        • Transformers
      • Catalogue
        • Adjustments
        • Rates
        • Services
      • Administration
        • Configuration
        • Users Groups
        • Workflows
    • Tutorials
      • Amazon AWS CUR
      • Azure EA
      • Azure CSP
      • Azure Stack
    • Releases
      • Upgrading to version 2
      • Archive
  • Diving deeper
    • Extract
      • Templates
      • Script basics
      • Parslets
      • Language
        • aws_sign_string
        • basename
        • buffer
        • csv
        • clear
        • discard
        • encode
        • encrypt
        • escape
        • exit_loop
        • foreach
        • get_last_day_of
        • gosub
        • gunzip
        • hash
        • http
        • if
        • json
        • loglevel
        • loop
        • match
        • pause
        • print
        • return
        • save
        • set
        • subroutine
        • terminate
        • unzip
        • uri
        • var
    • Transform
      • Language
        • aggregate
        • append
        • calculate
        • capitalise
        • convert
        • copy
        • correlate
        • create
        • default
        • delete
        • export
        • finish
        • if
        • import
        • include
        • lowercase
        • normalise
        • option
        • rename
        • replace
        • round
        • service
        • services
        • set
        • split
        • terminate
        • timecolumns
        • timerender
        • timestamp
        • update_service
        • uppercase
        • var
        • where
    • Report
      • Defining reports
      • Accounts
      • Services
      • Summary
    • Integrate
      • API docs
      • GUI automation
        • Examples
      • Single Sign On
        • Azure-AD
        • Auth0
Powered by GitBook
On this page
  • Syntax
  • Details
  • Example

Was this helpful?

Export as PDF
  1. Diving deeper
  2. Extract
  3. Language

unzip

PreviousterminateNexturi

Last updated 6 years ago

Was this helpful?

The unzip statement is used to unzip the data in a .

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 statement, and the data within the buffer must be a valid ZIP file.

Only ZIP files are supported. To extract GZIP files, use

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}
named buffer
buffer
gunzip