gunzip
Syntax
Details
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}"
}Last updated