Contents Previous Next Subchapters

Converts a Text File to a Character Row Vector
Syntax file2str(file)
file2str(fileoldStringnewString)
See Also fullpath , exists , strreplace , ischarvector , read , pack

Description
Reads a text file as a character row vector. If the character row vector arguments oldString and newString are present, they specify strings that are to be substituted during file loading.

Example
If the file test.txt contains
Hello
World
and you enter
     f = file2str("test.txt")
O-Matrix will create the character row vector f which contains Hello followed by CRLF, followed by World. If you continue the example by entering
     file2str("test.txt", "World", "Earth")
O-Matrix will respond
Hello
Earth