Difference between revisions of "Extensions.File.ReadLine"
Jump to navigation
Jump to search
(Created page with "{{DISPLAYTITLE:OTX '''ReadLine'''}}Category:File == Classification == {{ClassificationActivity | ReadLine | UPDATING... | Term | OTX File extension...") |
|||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:OTX '''ReadLine'''}}[[Category:File]] | {{DISPLAYTITLE:OTX '''ReadLine'''}}[[Category:File]] | ||
== Classification == | == Classification == | ||
− | {{ClassificationActivity | ReadLine | | + | {{ClassificationActivity | ReadLine| Reads the next line of characters from the file | [[Term]] | [[Extensions.File|OTX File extension]] | [[Extensions.File#Terms|File related Terms]]| [[Extensions.File.FileAccessException|FileAccessException]] <br/>[[Extensions.File.FileFormatException|FileFormatException]] <br/> [[Extensions.File.FileLockException|FileLockException]] <br/>[[Core.DataTypes.ComplexDataType.OutOfBoundsException|OutOfBoundsException]]| - |}} |
== OTL Syntax == | == OTL Syntax == | ||
− | |||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | StringTerm = File.ReadLine(FileReadHandleTerm); | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
== Description == | == 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 [[Extensions.File.FileFormatException|'''FileFormatException''']]. | |
− | + | ||
− | + | {{TermReturnValue| [[Core.DataTypes.SimpleDataType.String|String]] | Returns the next line of characters from the file as a String.}} | |
− | {{ | ||
− | |||
== Properties == | == Properties == | ||
− | |||
{| {{TableHeader}} | {| {{TableHeader}} | ||
{{TableRowPropertiesHeader}} | {{TableRowPropertiesHeader}} | ||
− | {{ | + | {{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;"> | ||
− | + | File.FileReadHandle FileReadHandle1; | |
+ | String String1; | ||
− | + | /// Flow | |
− | // | + | FileReadHandle1 = File.OpenFileForRead("file:///D:/abc.txt", @Encoding:UTF-8); |
− | // . | + | String1 = File.ReadLine(FileReadHandle1); |
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
== See also == | == See also == | ||
− | + | [[Extensions.File.CreateTempDirectory|CreateTempDirectory]]<br/> | |
+ | [[Extensions.File.GetFilePath|GetFilePath]]<br/> | ||
+ | [[Extensions.File.GetFilesFromDirectory|GetFilesFromDirectory]]<br/> | ||
+ | [[Extensions.File.GetFileSize|GetFileSize]]<br/> | ||
+ | [[Extensions.File.IsDirectory|IsDirectory]]<br/> | ||
+ | [[Extensions.File.IsEndOfFileReached|IsEndOfFileReached]]<br/> | ||
+ | [[Extensions.File.IsFile|IsFile]]<br/> | ||
+ | [[Extensions.File.OpenFileForRead|OpenFileForRead]]<br/> | ||
+ | [[Extensions.File.OpenFileForWrite|OpenFileForWrite]]<br/> | ||
+ | [[Extensions.File.ReadBytes|ReadBytes]]<br/> | ||
+ | [[Extensions.File.ReadFile|ReadFile]]<br/> | ||
+ | <!--[[Extensions.File.ReadLine|ReadLine]]--> |
Revision as of 10:43, 27 September 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
StringTerm = 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
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