I want to remove all blank lines from my code by find/replace method in eclipse code editor.
I used regular expression \\n\\s*\\n
to find all blank lin
In response to the first part of your question about the incompatible line delimiter near index
error, Eclipse seems to have an issue with Replacing the given line delimiter depending on the Text file encoding
and New text file line delimiter
settings.
I had an issue where a Windows application mistakenly formatted UNIX-formatted source files, inserting CRLF wherever it saw fit. Because of the particular situation I had to replace all of the CRLF's with space. Eclipse wouldn't allow me to do this because of that error, but grabbing the preceding and succeeding characters did the trick:
Find : (.)\r\n(.)
Replace: $1 $2
Using wjans suggested answer:
Find : ^\s*\r?\n(.)
Replace: $1
I hope this helps with those of you still getting the incompatible line delimiter
error.