2021.1

Table Of Contents
String that represents the name of the file to open.
encoding
String specifying the encoding to use (UTF-8, ISO-8859-1, etc.)..
append
Boolean parameter that specifies whether the file pointer should initially be positioned at the
end of the existing file (append mode) or at the beginning of the file (overwrite mode).
Example
In the following example, the openTextWriter() function is used to open the newly created
temporary file for writing:
var fileIn = openTextReader(data.filename);
var tmp = createTmpFile();
var fileOut = openTextWriter(tmp.getPath());
var line;
while ((line = fileIn.readLine())!=null){
fileOut.write(line.replace((subject),""));
fileOut.newLine();
}
fileIn.close();
fileOut.close();
deleteFile(data.filename);
tmp.move(data.filename);
tmp.close();
TextWriter
The TextWriter object, returned by the openTextWriter() function, allows to open a text file, write
to it and close it.
Methods
The following table describes the methods of the TextWriter object.
Page 437