Close Text File

Verb: textFileClose

Closes a text file that was previously opened by the Open Text File for Reading command, or by the Open Text File for Writing command.

Syntax

textFileClose --file(TextFileReader)

Inputs

Script Designer Required AcceptedTypes Description
--file Text file Required Text File Reader, Text File Writer Variable that holds the opened text file.

Example

Closes a text file, which was previously opened by the Open Text File for Writing command, enabling the writing process.

defVar --name pathFile --type String
defVar --name writerText --type TextFileWriter
getSpecialFolder --folder "Desktop" pathFile=value
// Open or create the text file and return the variable with the file open to be written.
openTextWriter --mode "OpenOrCreate" --autoflush  --share "ReadWrite" --path "${pathFile}\\text.txt" --encoding "Default" writerText=value
// Write the text "IBM Robotic Process Automation" into the file.
textWrite --text "IBM Robotic Process Automation" --file ${writerText}
// Close the previously opened text file for writing.
textFileClose --file ${writerText}

See Also

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