Write in Text File
Verb: textWrite
Writes the content specified in the Text parameter to a text file previously opened.
Syntax
textWrite --text(String) --file(TextFileWriter)
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--text | Text | Required | Text | Text that should be written to the file. |
--file | Text writer | Required | Text File Writer | Variable that holds the opened text file used for writing. |
Example
Writes the contents of the Text parameter to the text file that was opened using the Open Text File for Writing command.
defVar --name pathFile --type String
defVar --name writerText --type TextFileWriter
getSpecialFolder --folder "Desktop" pathFile=value
// Open the file entered for writing.
openTextWriter --mode "OpenOrCreate" --autoflush --share "None" --path "${pathFile}\\fileText.txt" --encoding "Default" writerText=value
// Write the entered text to the open file.
textWrite --text "Intelligent Automation with IBM Robotic Process Automation!" --file ${writerText}