How to do a global search/replace across files in Eclipse 3.2



This is my OLD blog. I've copied this post over to my NEW blog at:

http://www.saltycrane.com/blog/2007/03/how-to-do-global-searchreplace-across/

You should be redirected in 2 seconds.



The location of this command is not very intuitive. To search and replace in multiple files you need to select "Search" > "File...".

Step by step:
  1. Select the text in a file
  2. From the "Search" menu, select "File...". This will bring up the "Search" dialog box.
  3. At the bottom of the dialog, click "Replace..."
  4. This will bring up the "Replace" dialog box where you can type in your replacement text and replace individual occurrences or all occurrences.

4 comments:

Tom said...

Thank you!

I was having trouble finding this. Very useful for large projects.

Lindsay Kay said...

I'll second that, cheers! I was about to hunt for some sort of plugin to do global search and replace!

I wonder if there is any way to do refactoring across multiple projects, ie. update import statements, references in dependent projects etc?

Igor Milovanović said...

thanx. that was what i was looking for... sometimes you just need to look a few more seconds :)

Unknown said...

Hi...I am developing an application in eclipse rcp.I want to implement this multifile search functionality as is in eclipse in my application.can you help me with what plugins I should use.

About

This is my *OLD* blog. I've copied all of my posts and comments over to my NEW blog at:

http://www.saltycrane.com/blog/.

Please go there for my updated posts. I will leave this blog up for a short time, but eventually plan to delete it. Thanks for reading.