RAR (.rar)
Background & Context

-
- Registered MIME type: application/vnd.rar
- Data compression and archival format.
- Used to reduce storage space and transfer times.
- Binary format.
- Can contain multiple files.
- Supports a variety of compression methods.
- Originally developed by Eugene Roshal in 1993.
- RAR is an acronym for Roshal Archive.
- Maintained by win.rar GmbH.
Import

- When importing files from a RAR archive, the specific converter for each format will be used.
- Import["file.rar"] returns an expression of the form {"fn1", "fn2",…}, giving full path specifications for all files in "file.rar".
- Import["file.rar",elem] imports the specified element from a RAR file.
- Import["file.rar","fn"] extracts "fn" from the archive and imports it.
- Import["file.rar",{elem,suba,subb,…}] imports a subelement.
- Import["file.rar",{{elem1,elem2,…}}] imports multiple elements.
- Import["file","RAR"] or Import["file",{"RAR",elem,…}] imports any file as a RAR archive.
- See the following reference pages for full general information:
-
Import import from a file CloudImport import from a cloud object ImportString import from a string ImportByteArray import from a byte array
Import Elements

- General Import elements:
-
"Elements" list of elements and options available in this file "Summary" summary of the file "Rules" list of rules for all available elements - The following can be used to select or specify individual files in a RAR archive:
-
"FileNames" list of filenames representing the contents of a RAR archive "filename" a single file "filename","format" a single file, taken to be in the specified format "filename","format",elem element elem from the specified file - Import by default uses the "FileNames" element for the RAR format.
- Import["file.rar","fn"] extracts and imports file "fn".
- File names can include relative or absolute directory specifications and the abbreviated string patterns supported by StringMatchQ.
- Import["file.rar","*"] imports an entire archive.
- Import["file.rar","dir/*.jpg"] imports all JPEG files from subdirectory dir.
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Importing a RAR archive gives the names of the files in the archive by default:
In[1]:=1

✖
https://wolfram.com/xid/0cb004c3d-e3dxuy
Out[1]=1

Import all files using their default element:
In[2]:=2

✖
https://wolfram.com/xid/0cb004c3d-f4e5c0
Out[2]=2

Extract and import the GIF file:
In[3]:=3

✖
https://wolfram.com/xid/0cb004c3d-jqfzn
Out[3]=3

Extract and import all GIF files:
In[4]:=4

✖
https://wolfram.com/xid/0cb004c3d-f0qmw
Out[4]=4

Scope (1)Survey of the scope of standard use cases
In[1]:=1

✖
https://wolfram.com/xid/0cb004c3d-7lva7c
Out[1]=1

Extract available elements for one of the files in the RAR archive:
In[2]:=2

✖
https://wolfram.com/xid/0cb004c3d-czwmw3
Out[2]=2

Import some elements from one of the files in the archive:
In[3]:=3

✖
https://wolfram.com/xid/0cb004c3d-7wh7ni
Out[3]=3

Import the default element for multiple files with different formats:
In[4]:=4

✖
https://wolfram.com/xid/0cb004c3d-ge6dxy
Out[4]=4
