January 18th, 2010, 01:15 PM
Find & Replace in Eclipse
I have a file that contains the following:
<definition name="page" value="xyxa">
<definition name="page" value="xyxfaa">
<definition name="page" value="xyewrewfex">
<definition name="page" value="xyfdadfadfx">
<definition name="page" value="xyxfdafddaf">
<definition name="page" value="xyxdfa">
I am trying to replace the value="...." with just value="" for now. Basically im trying to replace anythign in a value attribute with a blank. How can i do this? I am using eclipse search to do this.
January 18th, 2010, 04:43 PM
No idea how to do it in Eclipse, but this is how I would do it (in Windows):
- Open the file in Notepad++
- Open the search and replace dialog (Ctrl + H)
- Enter the following in the search for box: value=".+"
- Enter the following in the replace with box: value=""
- Set the search mode to regular expression
- Click the replace all button
If you have more than one file, you can use Notepad++'s "Find in Files" option
January 19th, 2010, 02:59 PM
In eclipse, you can use find/replace as a regexp as long as you click the "regexp" button. Due to a java problem on my box, I can't actually test this, but:
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question
or you're a Help Vampire.
Trying to argue intelligently? Please read this.