Find
FAR has been crafted to find and replace text patterns across multiple
files in an entire directory tree. The FIND command will always be the first
command to be executed, since you have to define the set of files to operate
on before you may apply any changes.
You can use four types of filters to narrow the set of files you are operating on:
- Directory: The "Base Directory" input field shows the directory where the search
will begin. By default the "include subdirectories" checkbox is selected.
- File Name Pattern: You may use simple regular expressions where '*' denotes
"any number of characters" and '?' denotes "one character or none".
Furthermore '!' denotes "exactly one character" and '#' denotes
"exactly one digit (0-9)".
Thus "*.txt" means
any file with extension "txt", "my*" means any file that begins with "my" and "#*.!!!"
means any file that starts with a digit and has an extension of exactly three characters.
Multiple simple patterns can be separated with comma (','), e.g. "*.html,*.htm".
Simple patterns are not case sensitive.
If you want to use full regular expressions for the file name pattern, tick the checkbox
below the input field.
- Content Pattern: You can immediately filter for files that contain a certain text.
This text filter uses regular expressions by default (unselect the checkbox to disable).
Select the "Ignore Case" checkbox, if you do not care whether characters are upper case or lower case.
This works for both, regular expressions and ordinary text.
Select the "Exclude matching files" checkbox to find those files that do not contain the
search pattern.
The "Wrap Lines" checkbox only concerns the way text is displayed in the text area. It does
not alter the interpretation of the search text itself.
- Manual: You can manually exclude certain files from the result set after the
search has been run. Simply unselect the checkboxes in the left column of the file list.
Note that you can as well select a single file from the "Base Directory" file browser.
If you do so, the FIND command will execute immediately, allowing you to quickly pass to the
next step.
Eventually you can import a list of files via the "File" menu. The import
file must contain absolute pathes, on path per line.