Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

File

File["path"]
is a symbolic representation of a location in the local file system.

DetailsDetails

  • In File["path"], "path" specifies a possible path on the local file system. The path does not need to actually exist or refer to a file.
  • File["path"] can use both absolute and relative paths.

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Load a string template from disk:

In[1]:=
Click for copyable input
Out[1]=

Get a snippet from a text file:

In[1]:=
Click for copyable input
Out[1]=

Without the File wrapper, the string itself would be used as data:

In[2]:=
Click for copyable input
Out[2]=

Formatting of a File object:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2016
(11.0)