# How to avoid creating paragraphs on pasting

In Writer 4.2.7.2, pasting text from the terminal results in each line being a new paragraph. The same happens when copying and pasting text from any plain-text source (e.g. other text editors). This is consistent with the behaviour when entering text manually (i.e. hitting carriage return results in a new paragraph) but is not what I want when copying and pasting. Is there any way to make newlines in pasted text show up as newline characters rather than paragraph breaks?

edit retag close merge delete

This is not restricted to versions.

An old problem, coming up now and then. The means of choice should be a 'Find & Replace' action. But our F&R cannot find paragraph boundaries treating them like characters. The 'EndOfParagraph' is treated as a metacharacter like 'WordBoundary' and cannot be replaced because no single match can exceed a paragraph boundary. The only exception I know is searching for the empty paragraph and replacing it with nothing.This will indeed abolish the empty paragraph.

( 2015-02-10 15:23:17 +0200 )edit

I post this as a comment because it seems too ridiculous a detour to be an answer: Having a Calc sheet's cell you may enter ="" and then paste between the quotation marks your multiparagraph text. Any paragraph boundary will be replaced by a space (U+20). Having marked the NewPars with an unmistakable token you may then SUBSTITUTE this token with a CHAR(10) using the standardfunction. Now copy PasteSpecial back. That's simple, isn't it?

The procdure is limeted to 65536 chars.

( 2015-02-10 15:54:14 +0200 )edit

Other workaround proposal: Insert a "newline" in a document, select it, copy it then : Find & Replace, check "Regular expressions", Search for $Find All, Paste ( 2015-02-10 16:21:12 +0200 )edit @pierre-yves samyn - With which version(s) did you achieve the expected results? ( 2015-02-10 16:40:37 +0200 )edit Replacing$ allone by actual characters will work. Replacing NewPar with a marker will be easy and save steps on any wider detour. But: Special codes as \t won't. I also never had success with pasting a NewLine (U+000A) into the 'Replace with' control,

( 2015-02-10 16:53:13 +0200 )edit

@Lupp - what I proposed is ok since ... numerous versions.

Did you notice that I use Find & Replace to select (find all) paragraph marks, not to replace them. The replacement is made by pasting the newline mark from the clipboard. Regards.

( 2015-02-10 20:46:46 +0200 )edit

@pierre-yves samyn - Thank you for your patience. Finally even "Lupp" got it.

Greetings from München!

( 2015-02-10 23:33:06 +0200 )edit

Sort by » oldest newest most voted

Try Ctrl+Shift+V (paste special - unformatted texts)

more

They are paragraphs. Try using the Preformatted Text style: After pasting your text, select it, hit F11 and in the list of styles double-click on Preformatted Text.

more