Create Text File Activity
The Create Text File activity enables users to generate a new text file. This activity allows for specifying the file's name, path, type, and character encoding, along with options for header presence and overwriting existing files.
| Field | Description | Requirement |
|---|---|---|
| Text Name | Specifies a reference name for the text file to be created. | Required |
| Text File Name | Defines the full path, including the file name and extension, where the text file will be created. | Required |
| Type | Selects the format or type of the text document, such as CSV or plain text. | Required |
| Has Header | Indicates whether the first line of the text document should be treated as a header. | Required |
| Delimiter | Specifies the character used to separate fields within the text document, typically for CSV files. | Optional |
| Encoding | Determines the character encoding for the text file, such as UTF-8 or ISO-8859-1. | Optional |
| Overwrite | If true, an existing file or folder with the same name at the target path will be overwritten. If false, an error occurs if a file with the same name exists. | Optional |
Action Types & Examples
File Format Type
- Format:
string - Example Result:
CSV_Default
Character Encoding Standard
- Format:
string - Example Result:
UTF-8
Overwrite Behavior
- Format:
boolean - Example Result:
true
Implementation Examples
Field Setup - Text Name: newText - Text File Name: C:tempnotes.txt - Type: CSV_Default - Has Header: true - Delimiter: ; - Encoding: UTF-8 - Overwrite: false
Execution Parameters
Technical Notes
If the
Overwritefield is set totrue: If no file or folder with the same name exists in the target directory, a new file is created. If a file or folder with the same name does exist, it is overwritten.If the
Overwritefield is set tofalse: If no file or folder with the same name exists in the target directory, a new file is created. If a file or folder with the same name does exist, the operation fails with an error message indicating that the folder already exists.The Create file activity, found under File Operations, can also be utilized to create files with
.txtand.csvextensions.