watchDirectory Help > Creating New Tasks > Filter Events > Create a new Filter
Edit Filter
This window is used to create a new filter, or change an existing filter. It allows you to select which part of the filename the filter checks, and how it should check it.
What part of the filename is evaluated by this filter
With the selection box marked 1 on the screenshot you select the part of the filename this filter applies to. You can choose from one of the following:
| Part of Filename | Example value |
|---|---|
| Complete Path | C:\MonitoredDirectory\SubDirectory\Another\FileName.txt |
| File Name | FileName.txt |
| File Title | FileName |
| Extension | txt |
| Directory | C:\MonitoredDirectory\SubDirectory\Another\ (the directory always ends with a backslash!) |
| Relative Directory | SubDirectory\Another (this is the part of the path "starting" from the monitored directory, without the filename) |
| Parent Directory | Another |
Compare method
With the selection box marked 2 on the screenshot,
you select the operator this filter uses to compare the selected filename part (from 1)
with the value(s) you provide (in 3).
Every operator also has a does not variant, so
you can use, for example, "Equals", but also "Does not Equal".
All operators ignore UPPER- and lower-case differences.
Advanced Matching
When using the "Matches" operator, you can enable advanced matching by starting the value with 2 colons (::).
Use :9 to match a number (0-9)
Use :A to match a letter (A-Z)
Use :Z to match a letter or number (A-Z, 0-9)
Use :! to match punctuation characters such as _(),.
Use \: to match a colon (:)
Use \\ to match a single backslash
Example:
extension matches :::9:9:9
checks for a numeric file extension.
| Operator | Effect | Example (using extension TXT) |
|---|---|---|
| Equals | Checks if the selected filename part is exactly the same as value | extension equals TXT - true extension equals JPG - false |
| Starts With | Checks if the selected filename part starts with the value | extension starts with T - true extension starts with J - false |
| Ends With | Checks if the selected filename part ends with the value | extension ends with XT - true extension ends with G - false |
| Contains | Checks if the selected filename part has the value somewhere in it | extension contains X - true extension contains P - false |
| Matches | Checks if the selected filename part matches a pattern (using * and ?) The * matches zero or more positions, the ? matches exactly one position. All other characters are used "as is". |
extension matches * - true extension matches ??? - true extension matches TX? - true extension matches J?? - false |
| Is Empty | Checks if the selected filename part is empty (does not use value) | extension is empty - false |
Value to compare with
Here (3 on the screenshot) you enter the value or values to compare with. If you want to compare to multiple values, separate each value with a semi-colon (;). The screenshot shows how the file extension is compared to JPG, BMP and GIF. If the file extension equals one of these values the filter evaluates to true, and the file or directory is processed or ignored depending on your next choice (in 4).
What to do if this filter evaluates to true
Here (4 on the screenshot above) you select what the result is if this filter is "true". Should the event (new file, deleted file etcetera) be processed or ignored.
Testing the Filter
The bottom part of the window allows you to test the filter you are creating.
Input File: Enter a file (and sub-directory) you want to test with. The filename you enter here is appended to the "monitored directory"
which is taken from your task-definition. The bottom (marked 7) shows the result for this filter.



Back to Filter Events