This is documentation for Mathematica 7, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

FileBaseName

FileBaseName["file"]
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[..., OperatingSystem->"os"] uses the conventions of the specified operating system. Possible choices are "Windows", "MacOSX" and "Unix".
  • 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