Save Changes to Text File

Verb: textFlush

Saves all changes made to the available text file with the Open Text File for Writing command.

Syntax

textFlush --file(TextFileWriter)

Inputs

Script Designer Required AcceptedTypes Description
--file Writer Required Text File Writer Variable that holds the text file that should be opened so that the changes made can be saved.

Example

First, the Open Text File for Writing and Write in Text File commands are used to open the file for writing and writing to it, respectively. Then all changes made are saved using the Save Changes to Text File command.

defVar --name filePath --type String
defVar --name textWriter --type TextFileWriter
getSpecialFolder --folder "Desktop" filePath=value
// Open or create the text file for writing and return the variable with the file open for writing to it.
openTextWriter --mode "OpenOrCreate" --share "ReadWrite" --path "${filePath}\\text.txt" --encoding "Default" textWriter=value
// Write the text "IBM Robotic Process Automation" into the file.
textWrite --text "IBM Robotic Process Automation" --file ${textWriter}
// Save changes made to the open text file for writing.
textFlush --file ${textWriter}

Remarks

The Save Changes to Text File command is used in situations where the Open Text File for Writing command has the Auto Flush option disabled.

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
  • 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 Text Line to Text File
  • Write Time Span in Binary File