Repository navigation
dos_readtextfile
Dale Fugier edited this page Jul 1, 2026
·
1 revision
Reads a text file from disk and returns the text as a list of strings. ANSI, UTF-8 and Unicode encoded text files are supported.
(dos_readtextfile [filename [ignore_empty [trim_spaces]])
filename
The name of an existing text file to read.
ignore_empty
If omitted or nil, then if an empty line in the file is encountered, a nil element will be added to the list. If T, then empty lines will be ignored.
trim_spaces
If omitted or nil, then leading and trailing spaces, for each line in the file, will not be trimmed. If T, then leading and trailing spaces will be trimmed.
A list containing one or more lists if successful.
nil on error.
Command: (dos_readtextfile "test.txt")
("The quick brown fox" "jumped over the lazy dog.")