Using Araxis Replace In Files

Araxis Replace In Files is really simple to use. Just follow the three steps below.

Warning Replace In Files enables you to modify a great many files very quickly. Your data is important, so please ensure that you have an up-to-date backup of all your files before you process them.

1. Choose which files and folders to search

  • Drop the files or folders to search from Finder onto the table in the top section of the application window.
  • Or, add files or folders to the table using the + button located below the table.

Information By default, subfolders of any folders you add will also be searched. Uncheck the associated checkbox in the table’s Subfolders column.

Information Files and folders are searched in the order listed in the table, from the top down. You can drag the files and folders in the list to re-arrange them.

To remove a file or folder:
  • Select the item and click the - button located below the table.
To restrict the search to particular types of files:
  • Click the Files Kinds… button underneath the files and folder table to display the File Kinds tab of the Preferences window.

  • Use the check boxes to select the kinds of file to search.

  • Add and remove file kinds using the + and - buttons to the right of the table.

  • Double-click an item in the Kind or Pattern or UTI columns to edit it.

    The values in the Pattern or UTI column are used to match files based on their name or kind. To match files by name, use wildcard patterns as shown below:

    Kind Pattern Description
    Text and c files *.txt,*.c Files with an extension of .txt, or .c
    project*.txt files project*.txt Files beginning with project and with an extension .txt
    Makefiles Makefile Files named Makefile
    htdocs/*.html files htdocs/*.html Files with an extension .html at the top level of folders named htdocs
    htdocs/**.html files htdocs/**.html Files with an extension .html at any level under folders named htdocs

    To match files based on their type, you can enter a UTI (Uniform Type Identifier) in the Pattern or UTI column, prefixed with uti:. A list of system-declared UTIs can be found on the Apple website. Third-party applications can also declare their own UTIs in addition to those listed on that page.

2. Specify the text to find and replace

  • Enter the text you wish to search for in the Find entry field.
  • Enter the text you wish to replace in the Replace entry field. (You can leave this field blank if you just want to search for text, rather than make replacements.)
  • To distinguish between upper and lower case characters when finding a match, check the Case sensitive checkbox. Otherwise, make sure it is unchecked.
  • To match the literal search text you have specified exactly, uncheck the Regular expression checkbox. Alternatively, check this box if you wish to match text against a regular expression pattern you have entered into the Find field.
  • Click the Start Search button to initiate the search. This will not cause any text replacement to occur, but only finds matches for your search text.
  • If you wish to cancel a search, click the Stop Search button.

3. Review search results and, optionally, perform replacements

As the search progresses, matches will be shown in the table underneath the Review search results heading. The first file matched will be shown expanded and the first match within that file highlighted.

Information The number (followed by a colon) at the beginning of each match line indicates the line number within the file.

To move to the next match:
  • Click the [↓] button.
  • Or, press the key.
To move to the previous match:
  • Click the [↑] button.
  • Or, press the key.
To move to the first match of the next file:
  • Press Cmd+.
To move to the first match of the previous file:
  • Press Cmd+.
To replace the currently highlighted match:
  • Click the Replace button.
  • Or, press Cmd+R.

Information By default, a single backup is made for each file when the first replacement within it is made. Backup files are created in the same folder as the original file and named according to the pattern .RIFBackup.ccc (where c represents any character). Additional backup copies of a file will not be made if you run multiple consecutive find and replace operations, unless you quit the application and restart it. This helps to avoid the needless proliferation of backup files. There is an option in the Preferences to turn off the creation of backup files.

To replace the currently highlighted match and move to the next match:
  • Click the Replace & Next button.
  • Or, press Cmd+X.
To replace only specific matches:
  • Select the required match lines in the search results.
  • Click the Replace Selection button.
  • Or, press Cmd+S.
To replace all matches in all files:
  • Click the Replace All button.
  • Or, press Cmd+L.
To remove files or match lines from the search results:
  • Select the required files or match lines in the search results.
  • Click the Remove Selected button. (This will not delete your files from the disk, merely remove entries from the search results.)
  • Or, press Delete or Fn+Backspace.
To open a file with Finder:
  • Ctrl-click or right-click in the results table and select the Open with Finder menu item.
To show a file in Finder:
  • Ctrl-click or right-click the file in the results table and select the Reveal in Finder menu item.

Customizing Replace In Files

Several preferences are provided to enable you to configure Replace In Files to operate in the way you require. The preferences are self-explanatory, or otherwise covered above.

To customize preferences:
  • Choose the Replace In FilesPreferences… menu item.
  • Or, press Cmd+,.