Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > String Manipulation > Operations on File Names > FileBaseName >
Mathematica > Systems Interfaces & Deployment > File Operations > Operations on File Names > FileBaseName >
Mathematica > Systems Interfaces & Deployment > File Operations > Directories & Directory Operations > Operations on File Names > FileBaseName >

FileBaseName

FileBaseName
gives the base name for a file without its extension.
  • FileBaseName by default assumes pathname separators and other conventions suitable for your operating system.
  • FileBaseName just operates on names of files; it does not actually search for the file specified.
Find base name of the file:
Split off the last extension:
Find base name of the file:
In[1]:=
Click for copyable input
Out[1]=
 
Split off the last extension:
In[1]:=
Click for copyable input
Out[1]=
The period is not considered part of the name, even if there is no extension:
New in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF