Write Text Line to Text File
Verb: textWriteLine
Writes a line of text to a text file.
Syntax
textWriteLine [--text(String)] --file(TextFileWriter)
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--text | Text | Optional | Text | Line of text that should be written to the file. |
--file | Text writer | Required | Text File Writer | Variable that holds the text file for writing. |
Example
Writes a line of text inside the open text file. The Open Text File for Writing command is used to open the file and the Write Text Line to Text File command for writing.
defVar --name filePath --type String
defVar --name textWriter --type TextFileWriter
getSpecialFolder --folder "Desktop" filePath=value
// Open the file entered for writing.
openTextWriter --mode "OpenOrCreate" --autoflush --share "Write" --path "${filePath}\\textFile.txt" --encoding "Default" textWriter=value
// Write a line with the text "IBM Robotic Process Automation, the leader in intelligent automation in Brazil!" in the open text file.
textWriteLine --text "IBM Robotic Process Automation, the leader in intelligent automation in Brazil!" --file ${textWriter}
textFileClose --file ${textWriter}