Replace in Files: Basic Options
Keyboard: CTRL + SHIFT + H
Menu: Edit -> Find and Replace -> Replace in Files
Command: Edit.ReplaceinFiles
Versions: 2008,2010
Published: 9/11/2010
Code: vstipFind0015
Make sure to check out the Windows Phone Developer Portal!
Did you know that you can replace text in files, whether they are open or not, with Replace in Files (CTRL + SHIFT + H). Let's take a look at what can be done:
Find Options
Fortunately, the majority of find options are the same for Replace in Files as they are for Find in Files(vstipFind0013 https://blogs.msdn.com/b/zainnab/archive/2010/09/09/find-in-files-find-options-vstipfind0013.aspx) so you can leverage those skills again here.
Replace With
This area is the most interesting piece of the Replace in Files dialog. It can be as simple as a literal string (replacing "static" with "Franc", for example) or very, very complex. In simple situations this is just the literal text you want to use as a replacement to the "Find what" text. We will explore complex scenarios when we examine tagged expressions in a separate article.
Result Options
Again, these options are exactly like the Find in Files options (vstipTool0014 https://blogs.msdn.com/b/zainnab/archive/2010/09/10/find-in-files-result-options-vstipfind0014.aspx) with the exception of "Keep modified files open after replace all":
This option will make it possible to keep modified files open, once changed, so that you can review the change or make additional manual changes. This is particularly useful when you are modifying closed files and want to look inside files that were modified.
Execution
Once all the options have been set we can execute find and replace operations using these four buttons:
Find Next-used to find the next instance of the "Find what" string.
Replace-used to replace the current instance of the Find what string with the Replace with string, and find the next instance.
Replace All-nuclear weapon used to replace all instances of the Find what string with the Replace with string, in all files within the "Look in" scope.
DANGER: This can get you into big trouble if you don't pay attention to the scope of "Look in". Make sure you are careful here.
Skip File-available when the "Look in" list includes multiple files. Choose this button if you do not want to search or modify the current file. The search will continue in the next file on the "Look in" list.