Finding and Replacing Text

The Find and Replace in Files window pane lets you perform more advanced searches than the integrated Find and Replace widgets. You should use this window pane if you need to search for text in more than one file.

How to Find and Replace Text

  1. Select Home > Find and Replace. Then in the window pane, select the Find Text tab. Alternatively, you can press CTRL+SHIFT+F.

    Note You do not need to have any files open in order to use this window pane to search for text.

  2. Use the options in the window pane as necessary. Open the full topic for details on each option.

    • Find Enter the text you want to find. When you first open the window pane, this field might be automatically populated, based on the text selected in the document, or the text where the cursor is resting. You can also select text and press CTRL+SHIFT+F to populate the field. Another option is to simply type text or click the down arrow and select a recent search term.
    • Replace with Type the text that will replace the found text. You can also click the down arrow and select a recent search term.
    • Find in Select one of the following:

      • (current document) Looks for the text in the active document

      • (documents in the same folder) Looks for the text in all documents located in the same folder as the current one

      • (all open documents) Looks for the text in all documents currently open in the interface

      • (content folder) Looks for the text throughout files contained in the Content Explorer

      • (pick a folder) Lets you choose any folder in your project, confining the search to the files within that folder

      • (whole project) Looks for the text in files that are contained in the entire project

      • (reviews inbox) Looks for the text in files that are contained in the reviews inbox (Review > File Reviews)

    • File types Select one of the following, depending on which kind of files you want to search. This option is disabled if you have selected to look in the current document only.
      • All Files Looks in all file types in your project, including (but not limited to) those listed in this drop-down field
      • Topics Looks for text only in topic files
      • Snippets Looks for text only in snippet files
      • Tables of Contents Looks for text only in TOC files
      • CSS Stylesheets Looks for text only in stylesheet files
      • Glossaries Looks for text only in glossary files
      • Page Layouts Looks for text only in page layout files
      • Micro Content Looks for text only in micro content files

      Note In addition to selecting a file type from the list, you can type the file type extension in the field directly. This can be especially useful for file types not included in the drop-down. For example, if you want to look in all target files in the project, you can type *.fltar in the field. If you are searching for a file contained in the Project Organizer, also remember to select Find in source code.

    • Options Use any of the following additional options:
      • Match case Finds only occurrences of the text that match the case (e.g., uppercase, lowercase) of the text entered in the Find field
      • Whole word Looks for whole words only (e.g., if you enter "stand" as the search term, it will find "stand," but not "standing")
      • Find in source code Looks in the source code of the documents (not available for review packages; ignored for files in the reviews inbox—Review > File Reviews)
      • Create backup (Replace All) Creates backups of all edited files that are not open when using the Replace All feature; ignored for files in the reviews inbox (Review > File Reviews)
    • Search type Searches for regular text, but you can also use this field to search using wildcards or regular expressions. See Wildcards and Regular Expressions.

    • Show results in (Find All):
      • Window 1 Displays the search results (list of files) in the Find Results 1 window pane when using the File All feature
      • Window 2 Displays the search results (list of files) in the Find Results 2 window pane when using the File All feature
    • Find Next Locates the next occurrence of the text
    • Find Previous Locates the previous occurrence of the text
    • Skip File Skips searching in the current file and moves on to the next one
    • Find All Finds and lists all occurrences of the text in the Find Results window pane at the bottom of the user interface

      The label on this button changes to "Stop Find" while a search is being processed. This is one way to tell that a search is in progress. Another way is to watch the counter in the Find Results window pane. This shows how many occurrences of matching text have been found; if the number continues to go higher, the search is still in progress.

      Note The Find All option will not work if your search includes multiple words next to each other and at least one of the words has a span tag (e.g., you are searching for "MadCap Software," but there are places in the document where the word "MadCap" is in bold and "Software" is not). However, the Find Next option will work in a situation like this.

      The suggested workaround for the Find All option is to select the "Find in source code" option, use regular expressions, and enter something along the lines of \s(<.*?/?>) between the words to attempt to capture intervening tags. However, use caution when replacing source code in order to prevent corruption of your XML.

    • Replace Replaces only the current instance of found text
    • Replace All Replaces all of the matching text in all files included in the search

      If matches are found in files that are already open, Flare replaces the text in those files and "dirties" them (i.e., an asterisk is shown in the tab, indicating the file has been changed and needs to be saved). Therefore, you can undo the changes if necessary in each of those files or save them. As for files that are not already open in the user interface, Flare does not open them at all. Instead, it simply replaces all of the matching text it finds and automatically saves those files. Therefore, you cannot undo those changes because the files were never opened.

      Warning Exercise caution when you use the "Find in source code" option and tell Flare to "Replace All." Because changes are made and files are saved automatically, and because files with matches are not automatically opened, it is possible that you could introduce invalid code, therefore breaking files. Therefore, you might consider making a backup of your project before performing a find and replace like this. If your project is bound to a source control client, you may also be able to get a previous version of the files before they were broken.

      Warning If you have content that has been locked for editing (see Locking Elements) and you use the "Replace All" option, any matching content in those locked sections is replaced and the files are saved automatically.

    • [Progress Bar] Green bar at bottom of window pane shows progress of the search