Replacing Text with line break

I have some really bad formatted code with a lot of empty lines. I tried reformat the code but all the empty lines stay. And I do not want to remove them by hand.

So is there a simple way to do this? I tried replacing \n\n with \n, but this does not work. The two new line characters are found, but an 'n' is inserted, which is not really what I need now. I also tried to replace the two ne line characters with a unicode escape character instead, but it did not work.

Is there a way to do this? I wouldn't be surprised.

6 comments
Comment actions Permalink

Which is the right forum to post questions like this?

0
Comment actions Permalink

Which is the right forum to post questions like this?


This one for questions about eap versions, the community forum for questions
about "released" versions.

Carlos


0
Comment actions Permalink

IDE Settings -> Code Style -> Blank Lines

Define the amount of blank lines allowed and reformat code should work.

If it doesn't, go to the idea tracker
(http://www.intellij.net/tracker/idea/browse) and submit a new bug request
with a code example and your blank lines settings.

Carlos


0
Comment actions Permalink

Carlos Costa e Silva wrote:
>>Which is the right forum to post questions like this?
> This one for questions about eap versions,
> the community forum for questions
> about "released" versions.

The "community forum" is about a forum about the community, the user,
the people NOT the tool.

Alain Ravet

0
Comment actions Permalink

Thanks, that did the job. IMHO "Keep blank lines" is not a very clear description, maybe this should be changed to "Keep existing blank lines".

0
Comment actions Permalink

The "community forum" is about a forum about the community, the user,
the people NOT the tool.


I was just looking at a non eap forum for posting and the community was the
only one that leaped to the eye as a possibility.

But, yes, you're right - the community forum is not for postings about the
tool.

I'm not really sure there's a need for an "Idea" forum, so it seems this is
the one.

Carlos


0

Please sign in to leave a comment.