2021.1

Table Of Contents
openTextReader(filename,encoding)
filename
String that represents the name of the file to open.
encoding
String that specifies the encoding of the file to read (UTF-8, ISO-8859-1, etc.).
Example
In the following example, the openTextReader() function is used to open the actual data sample
file in the DataMapper for reading.
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);
TextReader
The TextReader object, returned by the openTextReader() function, allows to open, parse, read
and close a text file. (See: "openTextReader()" on the previous page.)
Methods
The following table describes the methods of the TextReader object.
Method Description
close() Closes the stream and releases resources.
Page 435