Wolfram: Read File

By Xah Lee. Date: . Last updated: .

Read a File

ReadString[fileNameOrPath]

get the content of a file as a string.

xx = ReadString["xxtest.txt"];

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

Wolfram. Shell Scripting Tasks