SOLUTIONS

BUILTIN MATHEMATICA SYMBOL
 Tutorials
 See Also

Related Guides
 Basic Input & Output in Programs
 Creating & Importing Images
 External Operations
 Files
 Constructing Graphs
 Graphics Importing & Exporting
 Graphs & Networks
 Image Processing & Analysis
 Importing and Exporting
 Importing & Exporting in Notebooks
 Summary of New Features in 7.0
 Summary of New Features in Mathematica 8
 Summary of New Features in Mathematica 9
 Web Operations
 XML Import & Export
 New in 8.0: Notebooks & Documents
 New in 9.0: Data Manipulation
Import Listing of Formats »
Import["file"]
imports data from a file, returning a complete Mathematica version of it.
Import["file", elements]
imports the specified elements from a file.
DetailsDetails
 Import handles a large number of formats, each typically with many different possible elements. The possible formats are given in the list $ImportFormats, and in the guide "Listing of All Formats".
 The format of a file is by default deduced from the file extension in its name, or by FileFormat from its contents.
 Import elements determine which aspects of a file should be imported, and how they should be returned to Mathematica.
 The following forms of element specifications can be given:

"format" take the file to be in the specified format elem import a single element assuming the default format {"format",elem} import an element assuming the specified format {"comp_{1}",...,"format",...} assume also compression formats (e.g. "GZIP") {elem_{1},elem_{11}} import subelement of {elem_{1},elem_{11},...} import subelements of subelements {elem_{1},{elem_{11},elem_{12},...}} import several subelements of {elem_{1},n} import the n part of  Types of elements typically supported include:

"Elements" a list of names of elements "Rules" rules for the values of all elements "Options" rules for options, settings, metainformation, etc. "Data" data in a generic Mathematica form (list, string, etc.) "RawData" raw data as used in the format (e.g. indexed colors) "Image" raster image (for graphical formats) "Graphics" 2D graphics (for graphical or geometry formats) "Graphics3D" 3D graphics (for graphical or geometry formats) "Sound" sound (for sound formats) "Plaintext" plain text (for textual formats) "Grid" grid format (for arrays, spreadsheets, etc.)  If no element specification is given, Import will typically return expressions that display or operate as much as possible as they would in an external viewer of the file being imported. Graphical formats, for example, are by default returned as Graphics or Graphics3D expressions.
 For some formats, there are options that specify details of how the import process should be performed; these are given as Import[source, elems, opts].
 Names of Export options such as ImageSize can be given as elements for Import.
 Import["file", ..., Path>path] searches for file on the specified path.
 Import["!prog", "format"] imports data from a pipe.
 When importing from a URL, Import can handle , , and .
 Import uses proxy and related settings specified in Preferences settings in the notebook front end, or in your operating system environment.
 Import generates a dialog if interactive authentication is required.
 Import takes a "" option which controls how Mathematica authenticates the identity of a server when establishing a network connection. By default Mathematica uses interactive authentication if necessary. With a setting "ServerAuthentication" > False, Mathematica connects to the server without authentication. With "ServerAuthentication" > True, Mathematica only connects to servers whose authenticity has been previously established.
Related GuidesRelated Guides
 Basic Input & Output in Programs
 Creating & Importing Images
 External Operations
 Files
 Constructing Graphs
 Graphics Importing & Exporting
 Graphs & Networks
 Image Processing & Analysis
 Importing and Exporting
 Importing & Exporting in Notebooks
 Summary of New Features in 7.0
 Summary of New Features in Mathematica 8
 Summary of New Features in Mathematica 9
 Web Operations
 XML Import & Export
 New in 8.0: Notebooks & Documents
 New in 9.0: Data Manipulation
New in 4  Last modified in 7
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »