Go to Text Reader Line
Verb: textReaderGoTo
Moves the reader to the indicated line, returning if the action completes successfully.
Syntax
textReaderGoTo --linenumber(Numeric) --file(TextFileReader) (Boolean)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--linenumber | Line Number | Required | Number | Index value (position) of the line within the text where reading should begin. |
--file | Text reader | Required | Text File Reader | Variable that contains the text file in which the line for reader movement is defined. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
value | Line number | Boolean | Value indicating the success (True) or failure (False) of the text reader line movement. |
Example
Moves the reader to the indicated line using the Go to Text Reader Line command. Previously used the command Open Text File for Reading to open the text for reading.
defVar --name textFileReader --type TextFileReader
defVar --name success --type Boolean
// Open the file informed for reading.
// Download the following file to execute the command.
openTextReader --share "Read" --path "binaryFile.txt" --encoding "Default" textFileReader=value
// Move reader to start line "2" within open text file for reading.
textReaderGoTo --linenumber 2 --file ${textFileReader} success=value
logMessage --message "${success}" --type "Info"
// The example returns the success of the move action.
For the correct operation of the script above, it is necessary to download the file and enter its path in the "Path" parameter of the "Open Text File for Reading" command.
Remarks
You must first open a text for reading with the command Open Text File for Reading.
In case the indicated line in Line Number cannot be found, the return of Line number is False and the reader goes to the default position 1.