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.
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.
Examples
open all close allBasic 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]Scope (4)
Print every third line of a file:
FilePrint["ExampleData/classification.tsv", 3 ;; -1 ;; 3]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 File object:
FilePrint[File["ExampleData/classification.tsv"]]Print the raw textual contents of a cloud object:
obj = CopyFile["ExampleData/factors", CloudObject[]]FilePrint[obj]Tech Notes
Related Guides
History
Introduced in 2007 (6.0) | Updated in 2014 (10.0) ▪ 2016 (11.0) ▪ 2017 (11.1)
Text
Wolfram Research (2007), FilePrint, Wolfram Language function, https://reference.wolfram.com/language/ref/FilePrint.html (updated 2017).
CMS
Wolfram Language. 2007. "FilePrint." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/FilePrint.html.
APA
Wolfram Language. (2007). FilePrint. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FilePrint.html
BibTeX
@misc{reference.wolfram_2026_fileprint, author="Wolfram Research", title="{FilePrint}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/FilePrint.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_fileprint, organization={Wolfram Research}, title={FilePrint}, year={2017}, url={https://reference.wolfram.com/language/ref/FilePrint.html}, note=[Accessed: 12-June-2026]}