[Solved] How can I enter a paragraph mark in Find/Replace?

Discuss the word processor
Post Reply
annice
Posts: 32
Joined: Wed Dec 19, 2007 8:31 am

[Solved] How can I enter a paragraph mark in Find/Replace?

Post by annice »

I have recently switched from Microsoft Office to OpenOffice.org. In Word, I had set up a macro to join lines of a text file by a few find and replace commands involving paragraph marks. I would like to do the same in OpenOffice Writer, but can't seem to select a paragraph mark to paste into the Find & Replace dialog box. Nor can I find any other way to place a paragraph mark there.

I do a lot of text file editing, and really need a way to join lines which end in a paragraph mark so that the text flows to the right margin. Your help will be appreciated.

Annice
Last edited by annice on Wed Dec 19, 2007 10:02 am, edited 1 time in total.
User avatar
Hagar Delest
Moderator
Posts: 32728
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: How can I enter a paragraph mark in Find/Replace?

Post by Hagar Delest »

You should see the OOo help file about regular expressions. Open the Find & Replace dialog, click on the More Options button and then on the Help button. The paragraph mark is '\n' (without quotes). Don't forget to check the Regular expressions options.

Thanks to add '[Solved]' in your first post title (edit button) if your issue has been fixed.
LibreOffice 24.2 on Xubuntu 24.04 and 7.6.4.1 portable on Windows 10
User avatar
Hagar Delest
Moderator
Posts: 32728
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: How can I enter a paragraph mark in Find/Replace?

Post by Hagar Delest »

I forgot to tell that \n is a line feed, not really a paragraph mark. The paragraph mark is '$'.
LibreOffice 24.2 on Xubuntu 24.04 and 7.6.4.1 portable on Windows 10
annice
Posts: 32
Joined: Wed Dec 19, 2007 8:31 am

Re: How can I enter a paragraph mark in Find/Replace?

Post by annice »

Thanks! That works.

Annice :D
User avatar
Hagar Delest
Moderator
Posts: 32728
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: How can I enter a paragraph mark in Find/Replace? [Solved]

Post by Hagar Delest »

To be even more complete on that topic, you can see that excellent wiki page : Regular Expressions in Writer.
But beware of the 64k limit for paragraph length. OOo paragraphs cannot be longer and replacing all the paragraph marks in a long document can lead to data loss, see that bug report : Issue 17171- Paragraph cannot be longer than 65534 characters.
LibreOffice 24.2 on Xubuntu 24.04 and 7.6.4.1 portable on Windows 10
JohnV
Volunteer
Posts: 1585
Joined: Mon Oct 08, 2007 1:32 am
Location: Kentucky, USA

Re: How can I enter a paragraph mark in Find/Replace? [Solved]

Post by JohnV »

And I'll that $ represents a paragraph break in the Search box but \n represents a paragraph break in the Replace box and there is no way to represent a line break in the Replace box.
huw
Volunteer
Posts: 417
Joined: Wed Nov 21, 2007 1:57 pm

Re: How can I enter a paragraph mark in Find/Replace? [Solved]

Post by huw »

JohnV wrote:... and there is no way to represent a line break in the Replace box.
Unless your OS's Unicode input method works in the replace box, then you may be able to enter U+000A directly.
JohnV
Volunteer
Posts: 1585
Joined: Mon Oct 08, 2007 1:32 am
Location: Kentucky, USA

Re: [Solved] How can I enter a paragraph mark in Find/Replace?

Post by JohnV »

huw,

I'm testing with Windows 98 and U+000A or \x000A give me a literal replacement with those characters.

Does any OS support this?
huw
Volunteer
Posts: 417
Joined: Wed Nov 21, 2007 1:57 pm

Re: [Solved] How can I enter a paragraph mark in Find/Replace?

Post by huw »

JohnV wrote:I'm testing with Windows 98 and U+000A or \x000A give me a literal replacement with those characters.
You can't just type the values, you have to use your OS's Unicode character input method. On Windows you hold down the Alt key and tap out the value on the number pad, BUT that only normally works for values up to 0255 - see the link in my previous post, and also http://www.georgehernandez.com/h/xCompu ... rtcuts.asp
JohnV wrote:Does any OS support this?
At least one variety of Linux - again, see the link in my previous post for details.
Post Reply