WolframLang: Read File

By Xah Lee. Date: . Last updated: .
ReadString[fileNameOrPath]

get the content of a file as a string.

ReadString

(* read whole file, from a file in same dir *)
xx = ReadString["xxtest.txt"];

(* print first line *)
Print[ StringSplit[ xx, "\n"][[1]] ]

WolframLang: Shell Tasks