
Function: readline
The readline
function is similar to read
, but it reads only one line at a time. It is designed for use when sequentially processing lines in a file, such as during an import operation.
Parameters:
Parameter Name | Type | Description |
---|---|---|
FileID | int | FileID obtained from the open function. |
Return Value:
Type string: The next line in the file. When the end of the file is reached, it returns "EOF" (End of File).
Example:
int x = open("myFile.txt", "r");
string line;
repeat
line = readline(x);
// .. do something with the line
until (line == "EOF");
The readline
function is useful for reading and processing files line by line, making it suitable for various tasks like data imports.