GdP Software logo

Include / Exclude files using Filters

Working with Filters

File Viking supports several "Filters" which allow you to include or exclude files you dropped on a basket for Actions you configure "below" the filter - child actions.

The picture to the right shows the File Size filter, it is the parent of child action "Email". In this case, the filter is used to prevent sending huge files to recipients. The "Zip" action is run for all files you drop on the basket, no matter how big they are.

File Size Filter

Use this filter so only files within the set size range will be passed on to child actions. You can leave "Min Size" or "Max Size" empty to pose no limit to that end of the range.



Wildcard Filter

This filter uses the familiar "dos" wildcards * and ? to filter files based on their name. An asterisk (*) is used as a wildcard for zero or more characters. The question mark is used as a placeholder for exactly 1 character.

The "Apply To" drop-down allows you to select the part of the filename the filter is applied to.

Only files who's name match at least one of the Include filters will be passed to child actions. If you leave Include empty, all files are valid.

Only files who's name match none of the Exclude filters will be passed to child actions. If you leave Exclude empty, all files are valid.

When you enter both Include and Exclude filters, filenames must match at least one Include filter and match none of the Exclude filters.

You do not have to worry about UPPER/lower case differences.

The picture to the right shows this filter configured to only allow filenames who's name end with "abc" and who's name do not start with a number.



tip

Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.

 - Jamie Zawinski

Regular Expression Filter

This filter works the same as the Wildcard filter above, but uses more advanced Regular Expressions (RE). Regular Expressions, as implemented by File Viking, ignore the difference between UPPER and lowercase.

A few examples:

This RE matches files with a .txt, .doc and .docx extension:

(\.txt$)|(\.doc$)|(\.docx$)

This RE matches TXT files ending in 4 digits (hello1234.txt)

(\d\d\d\d\.txt$)

This RE matches TXT files who's name is exactly 4 digits (1234.txt)

(^\d\d\d\d\.txt$)

This RE matches TXT files starting with one or more letters, ending with one number (abc3.txt)

(^[a-zA-Z]+\d.txt$)

The table below briefly describes the RE syntax understood by this filter.

. Matches any single character.
[ ] Indicates a character class. Matches any character inside the brackets (for example, [abc] matches "a", "b", and "c").
^ If this metacharacter occurs at the start of a character class, it negates the character class. A negated character class matches any character except those inside the brackets (for example, [^abc] matches all characters except "a", "b", and "c").
If ^ is at the beginning of the regular expression, it matches the beginning of the input (for example, ^[abc] will only match input that begins with "a", "b", or "c").
- In a character class, indicates a range of characters (for example, [0-9] matches any of the digits "0" through "9").
? Indicates that the preceding expression is optional: it matches once or not at all (for example, [0-9][0-9]? matches "2" and "12").
+ Indicates that the preceding expression matches one or more times (for example, [0-9]+ matches "1", "13", "456", and so on).
* Indicates that the preceding expression matches zero or more times.
??, +?, *? Non-greedy versions of ?, +, and *. These match as little as possible, unlike the greedy versions that match as much as possible. For example, given the input "<abc><def>",
<.*?> matches only "<abc>"
<.*> matches the complete input "<abc><def>".
( ) Grouping operator. Example: (\d+,)*\d+ matches a list of numbers separated by commas (for example, "1" or "1,23,456").
\ Escape character: interpret the next character literally (for example, [0-9]+ matches one or more digits, but [0-9]\+ matches a digit followed by a plus character). Also used for abbreviations:
\a Any alphanumeric character: ([a-zA-Z0-9])
\b White space
\c Any alphabetic character: ([a-zA-Z])
\d Any decimal digit: ([0-9])
\h Any hexadecimal digit: ([0-9a-fA-F])
\n Newline: (\r|(\r?\n))
\q A quoted string: (\"[^\"]*\")|(\'[^\']*\')
\w A simple word: ([a-zA-Z]+)
\z An integer: ([0-9]+)
$ At the end of a regular expression, this character matches the end of the input (for example,[0-9]$ matches a digit at the end of the input).
| Alternation operator: separates two expressions, exactly one of which matches (for example, T|the matches "The" or "the").
! Negation operator: the expression following ! does not match the input (for example, a!b matches "a" not followed by "b").