Removing new line \n from plain text

Sometimes when you copy text from a two columns pdf and you paste it as a plain text in Scrivener/DEVONthink or other writing tool the text is pasted with too much new lines, because the pasted text keeps the new lines from the pdf. The result is

Apparently
they
felt
that
there
is
a
conceptual
inquiry,
one
properly
called
“a
logic
of
discovery”,
which
is
not
to
be
confounded
with the
psychology
and
sociology
appropriate
to
understanding
how
some
investigator
stumbled
on
to an
improbable
idea
in
unusual
circumstances.

It takes too much time to fix this manually, thus I modified the PopClip’s “Remove spaces” extension to Remove New Lines extension. When I select the text and run the extension the result is

Apparently they felt that there is a conceptual inquiry, one properly called “a logic of discovery”, which is not to be confounded with the psychology and sociology appropriate to understanding how some investigator stumbled on to an improbable idea in unusual circumstances.

Popclip extension for replacing “- ” (i.e. hyphenspace) within text

Some times when I clip text from pdf document and paste it as plain text in Scrivener or DEVONthink I have a problem in pasted text. I get text like this

“what actually happens, and the underlying mecha- nisms that produce the events in the world.”

“- ” (i.e. HyphenSpace) splits the word mechanisms in mecha- nisms. Previously I will go through the pasted text and manually remove “- “. However, I noticed that PopClip has Remove spaces extension. So I used that extension and modified instead to remove empty spaces to remove HyphenSpace.

Please take in account that you can select large part of text and the changes will be made everywhere, however be careful it will also remove hyphens used as bullets.