Read Text to the End
Verb: readTextToEnd
Available from: <Standard>
Reads the contents of a text file that was opened for reading.
Syntax
readTextToEnd --file(TextFileReader) (String)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--file | Text File | Required | Text File Reader | Text file that was opened for reading.
To obtain the text file, it is necessary to use the Open Text File for Reading command. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
value | Text | Text | Contents of the text file that was read. |
Example
This command reads the contents of a text file opened by the Open Text File for Reading command from an index given in the Go to Text Reader Line command.
defVar --name desktopPath --type String
defVar --name filePath --type String
defVar --name textReader --type TextFileReader
defVar --name text --type String
defVar --name rowNumber --type Boolean
getSpecialFolder --folder "Desktop" desktopPath=value
writeToFile --value "IBM Robotic Process Automation, Intelligent Automation.\r\n\r\nIBM Robotic Process Automation, Intelligent Automation." --file "${desktopPath}\\text.txt" --overwrite filePath=value
openTextReader --share "Read" --path "${filePath}" --encoding "Default" textReader=value
textReaderGoTo --linenumber 3 --file ${textReader} rowNumber=value
readTextToEnd --file ${textReader} text=value
logMessage --message "${text}" --type "Info"
Remarks
You can set the index to start reading using the Go to Text Reader Line command.