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....
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.
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.
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.
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.
Find: ^\s*\n
Replace with: (empty)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With