Ask Your Question

How to avoid creating paragraphs on pasting

asked 2015-02-10 14:33:36 +0200

martin846 gravatar image

In Writer, 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 flag offensive 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.

Lupp gravatar imageLupp ( 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.

Lupp gravatar imageLupp ( 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

pierre-yves samyn gravatar imagepierre-yves samyn ( 2015-02-10 16:21:12 +0200 )edit

@pierre-yves samyn - With which version(s) did you achieve the expected results?

Lupp gravatar imageLupp ( 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,

Lupp gravatar imageLupp ( 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.

pierre-yves samyn gravatar imagepierre-yves samyn ( 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!

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

2 Answers

Sort by » oldest newest most voted

answered 2015-03-03 07:38:26 +0200

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

edit flag offensive delete link more

answered 2015-03-03 05:16:31 +0200

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.

edit flag offensive delete link more


This will make it easier to manage them as paragraphs.

alvarezp gravatar imagealvarezp ( 2015-03-03 05:17:50 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-02-10 14:33:36 +0200

Seen: 1,231 times

Last updated: Mar 03 '15