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 > Directory >

Directory

File system directory hierarchy.
Can contain files and subdirectories.
  • Import can read files from general file directories.
  • Import also recognizes formats that are represented as a bundle of related files and organized in a directory structure.
  • When importing from a directory that constitutes a supported multifile Import format, the converter for this format will be used.
  • Import gives path specifications for all files in a general directory and its subdirectories.
  • Import returns a list of pathnames as an expression of the form .
  • Import imports the specified element from a directory.
  • Import imports multiple elements.
  • Because Mathematica can determine whether a path specification refers to a directory, it is normally not necessary to specify as a format in the second argument of Import.
  • See the reference pages for full general information on Import
"Elements"list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties, and settings
  • The following can be used to select or specify individual files in a directory:
"FileNames"list of full pathnames for all files
"filename"a single file
"filename","format" a single file, taken to be in the specified format
"filename","format",elemelement elem from the specified file
  • Import by default uses the element for directories.
  • File names can include relative or absolute directory specifications and the abbreviated string patterns supported by StringMatchQ.
  • Import imports an entire directory.
  • Import imports all JPEG files from .
Import and count the file names included in this installation of Mathematica:
Show the names of some example files included in Mathematica:
Import a file from a directory, specifying its name as an Import element:
Import and count the file names included in this installation of Mathematica:
In[1]:=
Click for copyable input
Out[1]=
Show the names of some example files included in Mathematica:
In[2]:=
Click for copyable input
Out[2]=
Import a file from a directory, specifying its name as an Import element:
In[3]:=
Click for copyable input
Out[3]=
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF