Method: Find Replace
Find and replace components of a file's path and filename using regular expressions.
- ToolBar
- Add
- Remove
- Clear
- Verify
- Entry is checkmarked.
Findis empty butInsert into Filenamereferences a captured value.Findis empty butInsert into Pathreferences a captured value.Find,Insert into Path, andInsert into Filenameare all empty.Finddoes not have a valid regular expression.- Load
- Save
- Find
- Insert into Path
- Insert into Filename
- Test
- Result
The toolbar allows the Find Replace list to be edited in various ways.
Adds a new entry to the list. Only entries that have a checkmark beside them and don't have an empty Find
value are used during processing, otherwise they are ignored.
Removes the selected entry from the list.
Removes all entries from the list. A confirmation dialog is displayed if there are more than two entries to be removed.
Goes through each entry (that is checkmarked) and ensures they are valid.
The following checks are performed:
If an entry doesn't have a checkmark (that is, it isn't enabled), then verification for that entry is skipped. Otherwise, the following steps are performed.
Captured values are taken from whatever Find captures, so referencing a captured value while Find is empty isn't possible.
The same as 1, but instead Insert into Path is referencing a non-existent captured value.
All fields for the entry are empty.
The regular expression specified as the Find value is checked to ensure it is valid.
If all of the above checks are passed, the entry is considered valid.
Loads a list of Find Replace entries that have been previously saved with Save.
Saves all of the entries within the list out to a file.
The Find regular expression is used on the full Path & Filename of the item that is being processed and
via the use of capture groups, can be inserted into the
Insert into Path and Insert into Filename textboxes via the |n syntax.
Anything entered within a pair of brackets - ( and ) - will
be captured. To use the captured value(s), use a pipe | character followed by a number; the number
references the index of the captured value. For example, if two parts of a string were captured, you would use
|1 to access the first captured value, and |2 to access the second.
Specifying |0 will always return the entire captured string.
If Find was unable to successfully make a match, the item isn't processed.
This is the item's path that should be used within the root destination. For example, entering a value of My Folder would
result in a folder called My Folder being created within the root destination and the currently-processing item being placed within it.
Nesting folders is supported.
This is the new name to use for the file; the remarks for Insert into Path apply here except that you can't enter folder
names here (the \ character is disallowed).
Leaving this textbox blank will keep the name of the file as-is.
The data test to use; this takes the place of the item(s) to be processed in the editor and is recommended that you use the full path and filename of an item from one of the Source Item locations. This will let you see if the Find Replace entry is working as expected.
This Test value is ignored while FileSieve is processing.
The result of the currently selected entry and the entered Test path/file data above.
An error message will be shown if there were any errors encountered (eg. regex syntax error).
Examples
Below are some examples.
| Find | Insert Path | Insert Filename | Test | Result |
|---|---|---|---|---|
| tv\.show\.S(\d\d)E(\d\d)\.(.*) | - | TV Show - |1x|2|3 | tv.show.S13E01.mp4 | TV Show - 13x01.mp4 |