[Solved] Removing Paragraph per line of text

Discuss the word processor
Post Reply
Ralph L
Posts: 13
Joined: Mon Dec 17, 2007 2:34 am

[Solved] Removing Paragraph per line of text

Post by Ralph L »

I am switching from Office 97 to Open Office, am a newbie, and need a little help.

Not infrequently I get a file in which each line is a paragraph (terminated by a paragraph mark). Usually there are two paragraph marks or a paragraph mark followed by a tab to delineate real paragraphs. The last instance of this came from an email message from somebody that I pasted into Writer for reformatting.

I would like to remove all the paragraph marks at end of line but keep a paragraph mark at end of paragraph. Under Word 97 the following is a well known way to accomplish this:
1. Do a find/replace on the double paragraph marks, paragraph/tab marks. Replace these with a manual line break or some other special unused character.
2. Find/replace all paragraph marks with nothing thus deleting them.
3. Find/replace the manual line break (or other special character) with a paragraph mark.

Is there any way to accomplish this in Writer. It is important to me if I am going to convert to Open Office.

Thanks
Ralph
Last edited by Hagar Delest on Mon Jun 09, 2008 11:42 pm, edited 2 times in total.
Reason: tagged the thread as Solved.
User avatar
floris v
Volunteer
Posts: 4423
Joined: Wed Nov 28, 2007 1:21 pm
Location: Netherlands

Re: Removing Paragraph per line of text

Post by floris v »

Try this thread: How to delete line breaks with global command?.

Please read the Survival guide for the forum first.

If this solves your problem, please edit the first post of this thread (Edit button) and add [Solved] to the subject line.
OpenOffice 4.1.11 on Ubuntu; LibreOffice 6.4 on Linux Mint, LibreOffice 7.6.2.1 on Ubuntu
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
JohnV
Volunteer
Posts: 1585
Joined: Mon Oct 08, 2007 1:32 am
Location: Kentucky, USA

Re: Removing Paragraph per line of text

Post by JohnV »

I have written a macro to do exactly that.
http://www.oooforum.org/forum/viewtopic.phtml?t=6429
If you are new to macros see this.
http://www.oooforum.org/forum/viewtopic.phtml?t=7995

That topic has been deleted in oooforum. The equivalent is here: [Tutorial] How to install a code snippet.
Last edited by Hagar Delest on Fri Oct 29, 2010 4:12 pm, edited 1 time in total.
Reason: corrected the deprecated link to oooforum.
Ralph L
Posts: 13
Joined: Mon Dec 17, 2007 2:34 am

Re: Removing Paragraph per line of text

Post by Ralph L »

[Solved] My problem was finding a way to represent a paragraph mark in Find/Replace. It was not obvious to me from reading Help>Regular Expressions that the needed symbol was $ and the Find/Replace>Regular Expression box needed checking. (Also ^$ is an empty paragraph, although this is obvious from the Help file.) Good writeup at http://openoffice.blogs.com/openoffice/ ... d_rep.html
JohnV
Volunteer
Posts: 1585
Joined: Mon Oct 08, 2007 1:32 am
Location: Kentucky, USA

Re: Removing Paragraph per line of text

Post by JohnV »

Be careful when do large document with Find & Replace. When you delete paragraph breaks you form a larger paragraph and OOo has a paragraph character limit of 64K and excess text will be lost. Had to work around that in the macro referenced in the link above.
User avatar
Hagar Delest
Moderator
Posts: 32628
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Removing Paragraph per line of text

Post by Hagar Delest »

JohnV wrote:Be careful when do large document with Find & Replace. When you delete paragraph breaks you form a larger paragraph and OOo has a paragraph character limit of 64K and excess text will be lost.
For the record: Issue 17171 - Paragraph cannot be longer than 65534 characters. Any interested user should subscribe and vote for it (up to 2 votes per issue).
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
Post Reply