FilePrint

FilePrint["file"]

prints out the raw textual contents of file.

FilePrint["file",n]

prints out the first n raw textual lines of file.

FilePrint["file",-n]

prints out the last n raw textual lines of file.

FilePrint["file",m;;n]

prints out lines m through n of file.

FilePrint["file",m;;n;;s]

prints out lines m through n of file in steps of s.

Details

  • In FilePrint["file", m;;n;;s], s can be negative.
  • In a notebook, FilePrint generates a cell with style "Print".
  • With a textbased interface, FilePrint ends its output with a single newline (line feed).
  • FilePrint also works on cloud objects.
  • FilePrint[File["file"]] is also supported.

Examples

open allclose all

Basic Examples  (3)

Print the raw textual contents of a file:

In[1]:=
Click for copyable input

Print out the first few lines of a file:

In[1]:=
Click for copyable input

Print out the last few lines of a file:

In[1]:=
Click for copyable input

Scope  (4)

See Also

Print  Import  FileByteCount  Snippet

Tutorials

Introduced in 2007
(6.0)
| Updated in 2016
(11.0)