Replace String in all files in Eclipse
How can I search and replace a String in all files of my current project?
Let's say I have the string "/sites/default/" now I want it to be "/public/sites/default/", but there are almost 1000 files.
- Goto "Search"->"File" from menubar at the top left
- Enter text, file pattern and projects
- Click "Replace..." button at the bottom
- Enter new text click ok
Voilà...
Depending on the file type you are focused on, Ctrl+H will open up different types of search screens.
A more consistent hotkey would be using the Alt method: Tap Alt, then A, then F.
Efficient Order of Operations:
- Ctrl+C the text you want to do the replacing (if available)
- Highlight the text you want to be replaced
- Tap ALT, then A, then F. Brings you to File Search. The selection from (2) will auto-fill the search box
- In the “File name patterns” input box, type in “.java” for replacing all Java files or type in "" to replace in all files
- Click “Replace…”
- Ctrl+V (Paste). Or type in the value you want to do the replacing
- Enter
You can find more details in my blog post: http://blog.simplyadvanced.net/android-how-to-findreplace-in-multiple-files-using-eclipse/
Use Ctrl+H for opening Eclipse search dialog, select appropriate search tab and select "Replace..." to get you to the "Search and replace" dialog