Delete project files¤
Removes file resources from the project based on a regular expression (regex).
The project-relative path of each file of the current project is tested against a user given regular expression and the file is deleted if the expression matches this name. The file names include the sub-directory structure if present but do not start with a /. The regular expression has to match the full path of the file and is case sensitive.
Given this list of example files of a project:
Here are some regular expressions with the expected result:
- The regex
dataset\.csvdeletes only the first file. - The regex
json/.*deletes all files in thejsonsub-directory. - The regex
newdeletes nothing. - The regex
.*new.*deletes the filejson/example_new.json(and all other files withnewin the path)
We recommend testing your regular expression before using it. regex101.com is a nice service to test your regular expressions. This deep-link provides a test bed using the example files and the last expression from the list.
Parameter¤
File matching regex¤
The regex for filtering the file names. The regex needs to match the full path (i.e. from beginning to end, including sub-directories) in order for the file to be deleted.
- ID:
filesRegex - Datatype:
string - Default Value:
None
Output deleted files¤
If enabled the operator outputs entities, one entity for each deleted file, with the path of the file as attribute ‘filePath’.
- ID:
outputEntities - Datatype:
boolean - Default Value:
false
Advanced Parameter¤
None