FileTools[Text]
ReadFile
read all lines from a file
Calling Sequence
Parameters
Description
Examples
ReadFile(file)
file
-
file descriptor or filename
The ReadFile(file) command reads a string containing all the characters in the file. For files previously opened, the result string contains all the characters from the current file position to the end of file. The characters are returned as a string.
If the file is not open prior to calling ReadFile then it will be closed before returning. If the file was already open it will not be closed.
FileToolsTextWriteLine⁡testfile,This is a test
15
FileToolsTextWriteLine⁡testfile,This is also a test
20
FileToolsTextClose⁡testfile
FileToolsTextReadFile⁡testfile
This is a test This is also a test
FileToolsRemove⁡testfile
See Also
FileTools[Remove]
FileTools[Text][Close]
FileTools[Text][Open]
FileTools[Text][ReadLine]
FileTools[Text][WriteLine]
FileTools[Text][WriteString]
IO_errors
readline
Download Help Document