Finding and Replacing Files

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.The Find in Files window pane lets you perform more advanced searches than the integrated Find widget. You should use this window pane if you need to search for text in more than one file.

How to Find and Replace Files

  1. Select Home > Find and Replace. 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.

    • 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

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

    • 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")
      • Create backup (Replace All) Creates backups of all edited files that are not open when using the Replace All feature
      • Search type Searches for regular text, but you can also use this field to search using wildcards or regular expressions.

      • Find in Source Finds only occurrences of the text that appear in source (untranslated) documents
      • Find in Target Finds only occurrences of the text that appear in target (translated) documents
    • 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, Lingo 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, Lingo 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.

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

Using the Find Results Window Pane

If you tell Lingo to find all files containing certain text, the results are listed at the bottom of the interface in the Find Results 1 or Find Results 2 window pane, depending on which one you selected.

These window panes list the file name, context of the search term and if the result is part of the source or target segment, folder where the file exists, and title (if one exists). The number of total matches is also shown.

Using the local toolbar, you can open the file for the selected row, the previous row, or the next row. You can also clear the table, save the results to a comma-separated value (CSV) file, or toggle between showing all results or only the first result per file.

What’s Noteworthy?

Note If you are working with a multilingual project, the active target language is used for find and replace. You can change the active target language in the Project Properties dialog. See Project Properties Dialog.

Note The Find and Replace window pane is disabled when the focus is on the Translation Memory Editor. However, you can use the Quick Find and Quick Replace widgets to find and replace terms in the TM. See Using the Quick Find and Replace Widgets.