Extensions.File.ReadLine
Jump to navigation
Jump to search
Contents
Classification
Name | ReadLine |
Short Description | Reads the next line of characters from the file |
Class | Term |
Extension | OTX File extension |
Group | File related Terms |
Exceptions | FileAccessException FileFormatException FileLockException OutOfBoundsException |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
StringTerm File.ReadLine(FileReadHandleTerm handle);
Description
The ReadLine activity reads the next line of characters from the file and returns the data as a String. The line is terminated either by a recognised line break (any of ‘\r\n’, ‘\r’ or ‘\n’) or by reaching the end of the file. The line break is not included in the returned string. The first read activity on a file handle defines if an access shall be realized by line, bytes or file. Mixed access will lead to a FileFormatException.
Return Value
The Term returns the value, see table below.
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
String | Returns the next line of characters from the file as a String. |
Properties
Name | Data Type | Class | Default | Cardinality | Description |
Handle | FileReadHandle | Term | - | [1..1] | The handle for the file that the related file object encapsulates. |
OTL Examples
/// Local Declarations
File.FileReadHandle FileReadHandle1;
String String1;
/// Flow
FileReadHandle1 = File.OpenFileForRead("file:///D:/abc.txt", @Encoding:UTF-8);
String1 = File.ReadLine(FileReadHandle1);
See also
CreateTempDirectory
GetFilePath
GetFilesFromDirectory
GetFileSize
IsDirectory
IsEndOfFileReached
IsFile
OpenFileForRead
OpenFileForWrite
ReadBytes
ReadFile