Skip to main content

Write File

Command description

Write text to a file, such as a .txt file.

Command Input Parameters

input parametersInput parameter typeDescription
File PathstrPath of the file to write, such as C:\xx.txt. A relative path is resolved under the current user's Documents/RPA directory.
Contentstr
Write ModeenumAppend, Overwrite
FormatenumAuto, utf-8, gb18030, gbk, gb2312, utf-16, big-5, utf-8-sig, utf-16-le, utf-16-be

Command Output Parameters

None

Edge Cases

  • The file is created if it does not exist. The command also attempts to create a missing parent directory.
  • When the file exists, Overwrite replaces its contents, while Append writes after its existing contents.
  • Writing fails when the file path points to an existing folder.
  • Content is converted to text before writing. Auto and an empty Format value both use UTF-8.