0

I have a file in which I want to remove only certain line breaks, such as this example:

ProduceFalse:
Return a Boolean of value "false"

ProduceTrue:
Return a Boolean of value "true"

In the above example I would like to replace the line breaks after the : characters, so that the file looks like this:

ProduceFalse: Return a Boolean of value "false"

ProduceTrue: Return a Boolean of value "true"

To do that, I opened the file with Notepad++ and used the replace function with regular expressions. I can find occurences of these cases with the expression :[\r\n] perfectly, but replacing it with : seems to have no effect on the line break.

How can I remove a line break which I have found this way - or what would be a better way to do so (preferably in Notepad++ or with another editor's replace function, since I would love to use it under Windows)?

0

1 Answer 1

1
  • Ctrl+H
  • Find what: :\K\R
  • Replace with: 1 space
  • check Wrap around
  • check Regular expression
  • Replace all

Explanation:

:       : a semicolon
\K      : forget all we have seen until this position
\R      : any kind of linebreak

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .