fileread
Read contents of file as text.
Syntax
str = fileread(filename)
str = fileread(filename, type)
str = fileread(filename, 'char', eol)
str = fileread(filename, 'char', eol, encoding)
Input argument
filename - a string: a file name
type - a string: 'char', 'cell' or 'string'. 'cell' will converts text file to a cell of string. 'string' will converts text file to a string array. 'char' by default.
eol - a string: 'native', 'pc' or 'unix'. Set end of line. 'unix' by default.
encoding - a string: 'UTF-8' (default), 'auto', 'ISO-8859-1', 'windows-1251', 'windows-1252', ...
Output argument
str - a string, cell of strings or string array.
Description
fileread read contents of file as text.
if encoding is 'auto', nelson will try to detect best encoding to read contents of file as text.
Examples
See also
History
1.0.0
initial version
Author
Allan CORNET
Last updated