Examples

For the Source setting in an input card, select Archive (Zip). In the GET > Source > Command field, enter the Restore adapter command:


SavRecord,data.txt

The Archive Restore command extracts and restores a file named data.txt from an archive file named SavRecord.

This example extracts multiple files to memory as a continuous data stream:

SavRecord,data.txt *.dat abc\def\notes.txt "documents and settings\Administrator\listing.txt"
From an archive file named SavRecord, the Archive Restore command extracts and restores:
  • A file named data.txt
  • All files with the *.dat extension
  • The file abc\def\notes.txt
  • The file documents and settings\Administrator\listing.txt
This example lists all *.txt files in SampleArchive.zip:
LIST,SampleArchive.zip,*.txt
Additionally, this can be run in a GET rule, shown here without the files_to_list parameter so it will list all files:
=GET("ZIP","LIST,SampleArchive.zip")

To override Archive (Zip) adapter settings for the first output card and create an archive file named SavRecord.zip containing the contents of C:\data\*.txt and C:\logs\*, the Archive file adapter command string is:

-OAZIP1 'FILE,SavRecord.zip,C:\data\*.txt C:\logs\*'
Optionally, to create an archive without the directory structure of the input files, add the “FLAT” parameter to the end of the line:
-OAZIP1 'FILE,SavRecord.zip,C:\data\*.txt C:\logs\*,FLAT'
GET in map rule example (for Archive Stream command):
=GET("ZIP ", "STREAM,ZIP,MyArchive,NOCOMMENT", in)

This will produce a compressed archive stream using the data from input in. The name of the archived data in the stream will be MyArchive.

GET in map rule example (for Archive Restore Stream command):
=GET("ZIP ", "STREAM,UNZIP,firstentry “second entry”", in)

This will retrieve the archived entities with names firstentry and second entry from input in and stream out.