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.