How can I remove lines that only contain spaces when using Eclipse Find/Replace prompt. I checked the \"Regular Expression\" check box, and tried the following, neither of whic
Many thanks to lamamac.
In genereal, when you want to do search replace with regular expressions in eclipse the $ sign doesn't work as it should.
Use '\s*\n
' instead of '$
'
cheer!
This one worked for me for years:
Replace this: [\t ]+$
With nothing
Hope this helps!
As already suggested, regular expression and replacement is the solution, but such response would have been saving some minutes to me:
Find: ^\s*\n
Replace with: (empty)
I was suprised that for XML files edited with Eclipse there is a good solution:
Select the checkbox value named 'Clear all blank lines' in Formatting panel Window->Preferences->XML->XML Files-> Editor
Save and use the "Ctrl+Shift+F' shortcut
The blank lines will dissappear!