Replacing Text

To search a file for a string, and replace the string with an alternative string, perform the following steps:

  1. Choose Search ▸ Replace to display the Replace dialog.
  2. Type the string that you want to find, in the Search for field. You can include special characters such as a new line or tab: see Section 5.5 ― Special Characters.
  3. Type the string that you want to use to replace the string that you find, in the Replace with field.

To examine each occurrence of the string before replacing it, click Find. If gedit finds the string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the next occurrence of the string, click Find again.

To replace all occurrences of the string throughout the document, click Replace All.