Edit Files and Replace or Revert Individual Matches

1. First open the file you want to edit. The quickest ways are double-clicking on a match or a file name in the results, or right-clicking on a file in the File Selector and selecting Edit File from the context menu.

2. Use the Font and Text Direction, Word Wrap, Line Numbers and Auto Indent items in the Editor menu to adjust the editor to the way you want to edit the file you just opened.

3. The editor highlights search matches. There are only three situations in which matches aren't higlighted: you used Quick Execute, the action works on whole files (action type set to "list files" or "merge files"), or you turned on "group identical matches" in the action definition. In all three cases, PowerGREP does not retain information about individual matches.

4. To jump to the previous or next match in the file, use the Next Match and Previous Match buttons on the Editor toolbar.

5. If you previewed a search-and-replace action, you can replace a search match by double-clicking on it. You can replace multiple matches by selecting a block of text that includes them and then pressing the Replace button on the Editor toolbar. You can replace all matches in the file with the Make All Replacements item in the Editor menu. The matches are instantly replaced with the replacement text that you prepared in the action definition. The highlight color changes in the editor and in the results to indicate the match was replaced.

6. If you executed a search-and-replace, you can restore the original text by double-clicking on a match that was replaced. You can also restore individually replaced matches (see step 5) this way. You can restore the original text of multiple replacements by selecting a block of text that includes them and then pressing the Revert button on the Editor toolbar. You can revert all matches in the file with the Revert All Replacements item in the Editor menu.

7. To replace a match or a replacement with other text, simply edit the text like you would in any other text editor. If you type into the middle of a match or partially delete a match, PowerGREP adjusts the highlighting to keep the edited match highlighted. As long as part of the match is still highlighted, you can replace or revert the highlighted text as explained in steps 5 and 6.