Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Data Manipulation > Importing and Exporting > ExtractArchive >

ExtractArchive

ExtractArchive[file]
expands an archive file, saving its content into the current directory.
ExtractArchive
saves the content of an archive file into directory dir.
ExtractArchive
extracts only files whose names match pattern.
  • ExtractArchive supports a variety of file compression formats, including ZIP, GZIP, TAR, and BZIP2.
  • ExtractArchive returns the names of the files and directories it created.
  • The archive to be extracted can be specified using a relative or absolute file specification.
  • The destination directory can be given as a relative or absolute directory path.
  • If any file in the archive to be extracted already exists, ExtractArchive returns $Failed without creating any directories or files.
Uncompress a GZIP file, storing the result in the current directory:
Specify the destination directory:
Uncompress a GZIP file, storing the result in the current directory:
In[1]:=
Click for copyable input
Out[1]=
 
Specify the destination directory:
In[1]:=
Click for copyable input
Out[1]=
Create an archive from the ExampleData directory, then extract only JPEG files from it:
Prevent creation of intermediate directories to the destination path:
New in 8
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF