OpenersPrimaryExamplesSection(Spacer1)Examples  (3)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

This creates a ZIP archive containing a GIF and a text file:

Export["test.zip", <|"a.gif" ->  , "b.txt" -> "earth seen from space"|>, "Rules" ];

Importing a ZIP archive gives the names of the files in the archive by default:

Import["test.zip"]

Import all files using their default element:

Import["test.zip", "*"]

Extract and import the GIF file:

Import["test.zip", "a.gif"]

Extract and import all text files:

Import["test.zip", "*.txt"]

OpenersExampleSection1(Spacer1)Scope  (1)

Elements for a ZIP archive:

Export["test.zip", <|"a.gif" ->  , "b.fa" -> {"TTTCG","GATAG"}, "c.col"-> {{0,1,1,1},{1,0,1,1},{1,1,0,1},{1,1,1,0}}|>, "Rules" ];

Import["test.zip","Elements"]

Extract available elements for one of the files in the ZIP archive:

Import["test.zip",{"a.gif","Elements"}]

Import some elements from one of the files in the archive:

Import["test.zip",{"a.gif",{"ColorSpace","Image"}}]

Import the default element for multiple files with different formats:

Import["test.zip", "*"]

OpenersExampleSection2(Spacer1)Import Elements  (1)

OpenersExampleSubsection0(Spacer1)"FileNames"  (1)

Get the names of all files in a ZIP archive:

Export["test.zip", <|"a.gif" ->  , "b.txt" -> "earth seen from space"|>, "Rules" ];

Import["test.zip", "FileNames"]

This is also the default element:

Import["test.zip"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {Related Formats:  (RefLink[BZIP2, paclet:ref/format/BZIP2])  ▪  (RefLink[Directory, paclet:ref/format/Directory])  ▪  (RefLink[GZIP, paclet:ref/format/GZIP])  ▪  (RefLink[TAR, paclet:ref/format/TAR])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Compression and Archive Formats, paclet:guide/CompressionAndArchiveFormats])}, {▪(RefLinkPlain[Importing & Exporting, paclet:guide/ImportingAndExporting])}, {▪(RefLinkPlain[Listing of All Formats, paclet:guide/ListingOfAllFormats])}, {▪(RefLinkPlain[New in 6.0: Import & Export Formats, paclet:guide/NewIn60ImportAndExportFormats])}, {▪(RefLinkPlain[Systems & Utility Formats, paclet:guide/SystemsAndUtilityFormats])}})}})