<< fileread | Stream manager | fopen >> |
filewrite(filename, txt) |
filewrite(filename, txt, eol) |
filewrite(filename, txt, eol, encoding) |
a string: a filename
a string, cell of string or string array: content to save in file
a string: 'native' (system default), 'pc' [(char(13), char(10)], 'unix' [char(10)]
a string: 'UTF-8' (default), 'ISO-8859-1', 'windows-1251', 'windows-1252', ...
filewrite saves a character array, cell of string or string array to a file.
file saved uses by default UTF-8 (NO-BOM) encoding.
str = fileread([nelsonroot(),'/CHANGELOG.md'], 'string')
filewrite([tempdir(), 'CHANGELOG.md'], str)
characters encoding
str = 'живете зело, земля, и иже и како люди';
filewrite([tempdir(), 'example_filewrite.txt'], str, 'native', 'windows-1251')
Version | Description |
---|---|
1.0.0 | initial version |
Allan CORNET