Delete Files
Description
Delete Files removes one or more files from local or network directories during workflow execution. Use this step to clean up temporary files, remove processed inputs, or maintain storage by deleting files that are no longer needed. It supports both direct file paths and regular expression wildcards to match patterns within a folder. The step executes for each incoming row, so you can delete a dynamic list of files by feeding paths from a preceding step or by using it inside a loop.
- The Delete files step must be preceded by at least one step that will generate row(s).
- The Delete Files step executes for each row in the input stream, allowing you to delete multiple files iteratively by providing a list of files from the preceding steps. Therefore, you can also use this step between loop steps.
Configurations
| Field Name | Description |
|---|---|
| Step name | Specify a unique name for the step. |
| File / Folder tab | |
| Accept Input From Previous Step: | |
| Accept Input From Previous Field | Select the checkbox if you want to accept input from previous fields. Note: If you do not select the checkbox then the following fields are unavailable: Previous Field and WildCard(RegExp). |
| Previous Field | Select the field from the list. |
| WildCard(RegExp) | Specify the regular expression matching files to delete if the previous option is a folder. |
| File / Folder | Click Folder to select the folder from which you want to delete the files or File to select the file you want to delete. Note: - Add: Add folder field to the list of folders. - Folder: Select a folder. - Delete: Remove the selected folders from the list. - Edit: Move the selected folder to the folder field for editing. |
| WildCard(RegExp) | The regular expression matching files to delete if the previous option is a folder. For example: To delete all files ending in .dat, the regular expression would be: ".*\.dat$" |
| Files / Folders | The complete list of files / folders to delete. |
| Settings tab: | |
| Include Subfolders | Select the checkbox if you want to add the subfolders available in the selected folder. |
| Fail If File Not Exist | Select the checkbox if you want the workflow to fail when the file to delete does not exist. |
| Delete For | Select the option from the list. Available options are: - First Row: File is deleted after the first row is generated. - Each Row: File is deleted after each row is generated. - Last Row: File is deleted after the last row is generated. |
Note: If you use wild card expression for files, then when you click OK you will see a warning and the wild card will be removed for the file.