({{, (RefLink[FilePrint, paclet:ref/FilePrint])["file"] 
prints out the raw textual contents of file.}, {, (RefLink[FilePrint, paclet:ref/FilePrint])["file",n]
prints out the first n raw textual lines of file.}, {, (RefLink[FilePrint, paclet:ref/FilePrint])["file",-n]
prints out the last n raw textual lines of file.}, {, (RefLink[FilePrint, paclet:ref/FilePrint])["file",m;;n]
prints out lines m through n of file.}, {, (RefLink[FilePrint, paclet:ref/FilePrint])["file",m;;n;;s]
prints out lines m through n of file in steps of s.}})

OpenersNotesSection(Spacer1)Details

In (RefLink[FilePrint, paclet:ref/FilePrint])["file", m;;n;;s], s can be negative.

In a notebook, (RefLink[FilePrint, paclet:ref/FilePrint]) generates a cell with style "Print".

With a text-based interface, (RefLink[FilePrint, paclet:ref/FilePrint]) ends its output with a single newline (line feed).

(RefLink[FilePrint, paclet:ref/FilePrint]) also works on cloud objects.

(RefLink[FilePrint, paclet:ref/FilePrint])[(RefLink[File, paclet:ref/File])["file"]] is also supported.

OpenersPrimaryExamplesSection(Spacer1)Examples  (7)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Print the raw textual contents of a file:

FilePrint["ExampleData/factors"]

Print out the first few lines of a file:

FilePrint["ExampleData/classification.tsv",3]

Print out the last few lines of a file:

FilePrint["ExampleData/classification.tsv",-3]

OpenersExampleSection1(Spacer1)Scope  (4)

Print every third line of a file:

FilePrint["ExampleData/classification.tsv",3;;-1;;3]

Compare with:

FilePrint["ExampleData/classification.tsv"]

Print out every other line of a file, from end to start:

FilePrint["ExampleData/classification.tsv",-1;;1;;-2]

Print a (RefLink[File, paclet:ref/File]) object:

FilePrint[File["ExampleData/classification.tsv"]]

Print the raw textual contents of a cloud object:

obj = CloudObject[];
CopyFile["ExampleData/factors", obj]

FilePrint[obj]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Print, paclet:ref/Print])  ▪  (RefLink[Import, paclet:ref/Import])  ▪  (RefLink[FileSize, paclet:ref/FileSize])  ▪  (RefLink[FileByteCount, paclet:ref/FileByteCount])  ▪  (RefLink[Snippet, paclet:ref/Snippet])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Reading and Writing Wolfram System Files, paclet:tutorial/ReadingAndWritingWolframSystemFiles])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[File Operations, paclet:guide/FileOperations])}, {▪(RefLinkPlain[Wolfram Language Expressions in Files, paclet:guide/WolframLanguageExpressionsInFiles])}, {▪(RefLinkPlain[Files, paclet:guide/Files])}})}})