Say I have text like the following text selected with the cursor:
This is a test.
This
is a test.
This is a test.
This is a
test.
I would like to transform it into:
This is a test. This is a test
This is a test. This is a test
In other words, I would like to replace single line breaks by spaces, leaving empty lines alone.
I thought something like the following would work:
RemoveSingleLineBreaks()
{
ClipSaved := ClipboardAll
Clipboard =
send ^c
Clipboard := RegExReplace(Clipboard, "([^(\R)])(\R)([^(\R)])", "$1$3")
send ^v
Clipboard := ClipSaved
ClipSaved =
}
But it doesn't. If I apply it to the text above, it yields:
This is a test. This is a test.
This is a test. This is a test.
which also removed the "empty line" in the middle. This is not what I want.
To clarify: By an empty line I mean any line with "white" characters (e.g. tabs or white spaces)
Any thoughts how to do this?