Chapter 6
6. Path rules
Open Settings, then Path Rules. A rule changes a source value using a regular expression. It can translate a file path between the source table's format and CatDV's format.
Rules affect only source mappings with Apply path rules selected. They can affect search values and write values. They do not move files.
6.1 Add a rule
- Select Add rule.
- Enter Source pattern (regular expression) and Destination replacement.
- Select Add rule to save it.
- Use Edit and Save rule to change an existing rule.
For a simple prefix change:
| Item | Value |
|---|---|
| Pattern | ^/Volumes/Media/ |
| Replacement | /media/ |
| Source path | /Volumes/Media/clips/guide-test.mov |
| Result | /media/clips/guide-test.mov |
The ^ means the start of the value. Without it, the pattern can match later in a path.
Captured groups use ${1}, ${2}, and so on in replacements. Use braces to keep a group number separate from following text.
6.2 Set rule priority
Rules run from top to bottom. The first active rule that matches supplies the result. Later rules do not run on that result.
Drag a handle or use the up and down buttons to reorder rules. Put specific patterns before broad patterns. Turn a rule off to keep it without applying it.
When no rule matches, the source value stays unchanged. If a replacement produces backslashes, Data Wrangler converts forward slashes in that result to backslashes.
6.3 Preview before running
Enter a path under Preview a path and select Test rules. Check the result with a known path and a path that should remain unchanged.
This preview does not write to CatDV. After changing saved rules, stage the import file again before running it.
Previous: Field mappings · Contents · Next: Running an import