Write File
Command description
Write text to a file, such as a .txt file.
Command Input Parameters
| input parameters | Input parameter type | Description |
|---|---|---|
| File Path | str | Path of the file to write, such as C:\xx.txt. A relative path is resolved under the current user's Documents/RPA directory. |
| Content | str | |
| Write Mode | enum | Append, Overwrite |
| Format | enum | Auto, 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.