Difference between revisions of "Extensions.File.ReadLine"
Jump to navigation
Jump to search
Line 5: | Line 5: | ||
== OTL Syntax == | == OTL Syntax == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | /// Local Declarations | |
+ | String StringVariable; | ||
+ | /// Flow | ||
+ | StringVariable = File.ReadLine(FileReadHandleTerm); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 16: | Line 19: | ||
{| {{TableHeader}} | {| {{TableHeader}} | ||
{{TableRowPropertiesHeader}} | {{TableRowPropertiesHeader}} | ||
− | {{TableRowPropertie2| | + | {{TableRowPropertie2| Handle| [[Extensions.File.FileReadHandle|FileReadHandle]] | [[Term]] | - | [1..1] |The handle for the file that the related file object encapsulates.}} |
|} | |} | ||
== OTL Examples == | == OTL Examples == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
+ | /// Local Declarations | ||
+ | |||
File.FileReadHandle FileReadHandle1; | File.FileReadHandle FileReadHandle1; | ||
String String1; | String String1; |
Revision as of 03:31, 25 October 2018
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
/// Local Declarations
String StringVariable;
/// Flow
StringVariable = File.ReadLine(FileReadHandleTerm);
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