Automation Workshop allows using file masks as parameter for multiple inputs of Triggers and Actions. File masks provide very flexible means for identification of files or group of files based on their name and extension.
Masks…
File masks consist of any combination of three general symbols types · Examples
- Fixed characters, such as letters, numbers and other characters allowed in file names.
- ? (question-mark character) that stands in for any single character.
- * (asterisk character) that stands in for any number of various characters.
While it is clear that file mask consisting only of fixed characters uniquely identifies a file (e.g., file mask picture.jpg
refers to, and only to, file named picture.jpg
), file masks with wildcards (i.e., ?
and *
characters) can refer to single or multiple files.
?
For example, file mask ?at.jpg
refers to all files with three letters in their name ending with at
, and .jpg
extension, resulting file mask ?at.jpg
to pick out files with names cat.jpg
, mat.jpg
, hat.jpg
, rat.jpg
and all other files starting with any character and ending with at.jpg
.
*
Asterisk *
wildcard as a part of file mask stands in for indefinite number of various characters. For example, file mask h*e.jpg
refers to all .jpg
files that start with h
, end with e
and contain any number (including zero) in between, such as he.jpg
, hue.jpg
, here.jpg
, house.jpg
, etc.
Multi-mask
Many Actions support specifying multiple file masks at once delimited by |
pipe character. For example, *.jpg | *.gif
will select files with both .jpg
and .gif
extension. It is possible to combine even more (virtually unlimited) file masks in a single input, for example:*.docx | *.xlsx | *.pptx
and so on.
Folder exclude mask
Combine the ?
and *
wildcards to create simple or multi-masks, allowing you to filter out and completely ignore the specified matching folders, directories, and paths from further processing by Triggers and Actions. This ensures that unwanted files or directories are excluded efficiently · Examples
- File & Folder Watcher
- FTP Watcher
- SFTP Watcher · Filter
- WebDAV Watcher
- Amazon S3 Watcher
- Google Cloud Storage Watcher
- DigitalOcean Spaces Watcher
- Synchronize Directories
- List Remote Files
- Upload File
- Download File
- Synchronize Folders
- List Files
- Zip Files
- Copy File
- Move File
- Rename File
- Delete File
- Set File Attributes
- Set File Date & Time
Examples…
By using wildcards and masks, you can efficiently target all files and folders or narrow down to a specific group. The asterisk *
substitutes zero or more characters, while the question mark ?
substitutes a single character. You can combine multiple expressions with the pipe |
character to create multi-masks, allowing for more flexible and precise filtering…
File mask
File mask | Details |
---|---|
* |
All files with any extension. |
*.* |
All files with any extension. |
*.jpg |
Files with .jpg extension.
|
*.p* |
Files with extension starting with p .
|
pic*.* |
Files starting with pic .
|
*mat?.html |
.html files starting with anything and ending with mat followed by any single character.
|
doc?????.xls |
.xls files starting with doc and followed by any five characters.
|
???.?? |
Files with three characters in their name and two characters in extension.
|
????? |
Files with five characters in their name and without extension.
|
*.xlsx | *.docx |
Every Office document: Excel spreadsheets and Word documents.
|
Folder mask
File mask | Details |
---|---|
* or */ |
All folders—Windows style. |
* or *\ |
All directories—Linux style. |
MyFolder or MyFolder\ |
Any folder or subfolder with the name MyFolder . |
DB\Data |
A folder or subfolder with the name Data which is located inside the folder with the name DB . |
/home/user/data |
An absolute path to a remote directory. |
C:\MyFiles\Data or \MyFiles\Data |
An absolute path to a local folder. |
\\Srv\Share |
An absolute path to a network folder. |
./MyFolder |
A relative folder located directly in the root of the specified source/destination folder. |
./MyFolder/Data |
A subfolder that is located in the MyFolder that is located in the root of the specified folder. |
*/*/Data |
A folder named Data located two levels deep, with two parent folders that can have any names. |
*2024*/Folder* |
A folder with Folder in its name (e.g., Folder 1 , Folder 2 , or Folder Images ) located inside a folder that contains 2024 in its name. |
2024-??-?? |
When targeting folders with the name that contains any date in the year 2024 , e.g., 2024-12-31 , 2024-04-29 , and so on. But the pattern will also match any other characters, such as 2024-AB-CD , and so on. |
Doc* | File* |
Any folders whose names begin with Doc or File , e.g., Doc , Docs , Documents , File , Files , and so on. |
Note
- File mask filters are applied to long file names, while both long and short file (8.3) names are present in most file systems.
- Folder mask filters are case insensitive even when working with remote Linux like systems.
More…
In addition to standard include and exclude filtering with wildcard characters, Automation Workshop offers a wide range of versatile options to enhance automation…
Review the documentation for each specific Action to learn about features like SFTP wildcards, file destination masks for renaming scenarios, and negative file masks used in If-Else logic, providing advanced control over automation processes.
Extended search patterns
- Enclosed Text · a similar technique to extract a text that is enclosed in tags, quotes, or arbitrary markers using familiar wildcards
*
and?
(any string and any character).
Wildcard patterns
For advanced file existence verification and monitoring file creation or deletion, use wildcard patterns. The asterisk *
matches any letter, word, or multiple words, while the question mark ?
matches a single character.
When employing wildcard patterns, the Action selects the first file that matches the specified pattern if multiple files are found. For negative conditions, the Action ensures that no files in the folder match the pattern. Depending on additional conditions (such as existence, emptiness, etc.), the pattern may match any, some, or all files.
- If Remote File · determines the existence, absence, or availability of a file using a filename or file mask on remote files via FTP, SFTP, or cloud services.
- Wait for Remote File · continuously tracks a remote file's appearance or removal for files accessed through FTPs and cloud storages.
- If File · checks a file's existence, absence, or availability based on a filename or wildcard pattern on local files or files on network shares.
- Wait for File · waits for a file to appear, be removed, or become available. The input can be a filename or a file mask. It works on local files and Windows shares.
More wildcards
- SFTP wildcards · remote SFTP server file masks and wildcards.
- Rename file masks & wildcards · using file masks and wildcards when renaming files.
- Overview of all file & folder Actions · apply wildcards in almost all cases.
- Monitor a folder and automatically send an email with report files · tutorial on file masks.
- Long file name usage · explains the necessity to delimit file names, using double quote characters.
Ask for more…
If you have any questions, please do not hesitate to contact our support team.