happybuddha
happybuddha

Reputation: 1358

Rename multiple files in eclipse

How can I rename multiple files in eclipse and update their references as well ?

For ex. I got these classes in many packages in my project :

com.a.b.c.Fooclass1
com.a.b.c.Fooclass2 
com.a.b.c.Fooclass3
com.a.b.c.BarFooclass1
com.a.b.c.Dontworryclass

I want to replace Foo with BAR.
How can I replace Foo with BAR in the class names of all those classes in my project, which have Foo in their name.

Edit : I really know how to use refactor in eclipse for a single file ! I wanted to know a solution for multiple files.

Upvotes: 4

Views: 6282

Answers (3)

U_R_Naveen UR_Naveen
U_R_Naveen UR_Naveen

Reputation: 788

I can tell you in windows explorer, Select your first folder from the list, hit F2, paste or append to the file name, then hit tab, paste or append to the second file name, hit tab and repeat....

Upvotes: 0

patricmj
patricmj

Reputation: 373

This might help some other people crashing in here. If you wanna replace multiple file names use powershell:

Get-ChildItem -Filter “*currentfilename*” -Recurse | Rename-Item -NewName {$_.name -replace ‘currentfilename’,’newfilename’ }

Upvotes: 3

Evdzhan Mustafa
Evdzhan Mustafa

Reputation: 3735

Right click on file name -> Refactor -> Rename -> Use the new name then press enter. Confirm any prompts. This will change any references. But I am afraid there is no way to do that for multiple files.

Upvotes: 0

Related Questions