ftos.files.getTextReader

IMPORTANT!  
Starting with v24.3.0, this is renamed from getTextFileReader to ftos.files.getTextReader.

Stores the content of a file from the file upload location in a WorkflowTextFileReader object which can be read as a string, either line-by-line or all-at-once.

This is a business logic method for business service components.

Syntax

getTextFileReader(fileName: string, [encoding: string | codePage: number]): WorkflowTextFileReader
 
Parameter Description
fileName Unique internal ID of the file (real name).
encodng (optional) File encoding. The default value is UTF-8.
codPage (optional) Numeric code page of the file encoding. The default value is 0 (UTF-8 encoding).

Return Value

Returns a WorkflowTextFileReader object that stores the file's content.

Properties

Property Returned Type Description
EOF boolean
  • True - The cursor is at the end of the file.
  • False - The cursor is not at the end of the file.
You can use this property in conjunction with the readLine() method to read the file line-by-line.

Methods

Method Returned Type Description
dispose() void Disposes the WorkflowTextFileReader object.
readAllText() string Returns the file content in string format.
readLine() WorkflowTextFileLine Saves the current line in a WorkflowTextFileLine object and advances the cursor to the next line. Use the WorkflowTextFileLine.text property to return the current line in string format.
You can use this method in conjunction with the EOF property to read the file line-by-line.

Examples