Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove unwanted blank line eclipse editor

When i open any file in eclipse. it show alternative blank line after all the code lines and blank line. how can i remove it....

enter image description here

like image 357
Ankur Loriya Avatar asked Oct 05 '12 05:10

Ankur Loriya


People also ask

How do I get rid of blank lines in eclipse?

In eclipse preference setting you can remove all the unwanted blank lines. Eclipse: Window > Preferences > Java > Code Style > Formatter > Edit the formatter and following screen will pop up. And when you format the code all unwanted blank lines will be removed.

How do I get rid of extra blank lines?

This is how the document looks initially when there are blank lines between the text. Just click on the 'Show/Hide ¶' option in Word's control bar to view the paragraph tags. The double paragraph tags here indicate a blank line and replacing them with a single tag will remove the blank lines.

How do I permanently delete blank lines in a text file?

Delete blank lines using the grep command When used with the -v option, the grep command helps to remove blank lines. Below is a sample text file, sample. txt, with alternative non-empty and empty lines. To remove or delete all the empty lines in the sample text file, use the grep command as shown.


2 Answers

In eclipse preference setting you can remove all the unwanted blank lines. Eclipse: Window > Preferences > Java > Code Style > Formatter > Edit the formatter and following screen will pop up. enter image description here

And when you format the code all unwanted blank lines will be removed.

like image 87
J4cK Avatar answered Sep 18 '22 02:09

J4cK


Find: ^\s*\n

Replace with: (empty)

like image 28
Anshu Avatar answered Sep 22 '22 02:09

Anshu