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}

See Also

  • Binary Read Int
  • Close Binary File
  • Close Text File
  • Get Binary File Boolean
  • Get Binary File Characters
  • Get Binary File Text
  • Get Date and Time in Binary
  • Get Table from a Text File
  • Get Text File Line
  • Go to Text Reader Line
  • Move Index in Binary File
  • Open Binary File for Reading
  • Open Binary File for Writing
  • Open Text File for Reading
  • Open Text File for Writing
  • Read Binary File Decimal
  • Read Binary File Time Span
  • Read Delimited Line of Text File
  • Read Text to the End
  • Save Changes to Binary File
  • Save Changes to Text File
  • Write Boolean in Binary File
  • Write Date Time in Binary File
  • Write Decimal to Binary File
  • Write Delimited Text Line to Text File
  • Write Delimited Texts in Text File
  • Write in Text File
  • Write Integer to Binary File
  • Write Text in Binary File
  • Write Time Span in Binary File