Paragraph format problem

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have a hundreds of paragraphs that need to be fixed so that they fit
the width of the pages in which they are located.

Presently, the paragraphs are about 4" wide and all have the
"non-printing character" at the end of each text line that looks like a
backward letter P with a line next to it.

Is there a quick way to get rid of this problem?

It sounds to me that the text came from a hard-wrapped text file (like
an email). A workaround would be to save the paragraph contents to a
plain text file, open it in a web browser, and then copy the text from
the browser. Web browsers treat all whitespace as they would treat a
space.

I saved the huge file as Plain Text.txt

The file was then opened in Firefox but the vast amount of white space
didn't go away even though I cut and pasted it back into Writer.

It seems that the character at the end of each line is a carriage return.

Any ideas what to do now?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have a hundreds of paragraphs that need to be fixed so that they fit
the width of the pages in which they are located.

Presently, the paragraphs are about 4" wide and all have the
"non-printing character" at the end of each text line that looks like a
backward letter P with a line next to it.

The backward P denotes a CR/LF so what you have every line is a paragraph removing this without removing the ones you want may be tricky.

I am curious, how many pages/characters are in the file?

I found this via OOo: http://openoffice.blogs.com/openoffice/2009/11/searching-and-replacing-paragraph-returns-carriage-returns-tabs-and-other-special-characters-in-open.html It should help you with your problem.

According to the documentation you are dealing with a type of "regular expression"

Is there a blank line between what *should* be the paragraphs? If so, I think I may know a workaround that used to work in Word 2003. But not that familiar with LO as of yet to know if it would work.

But, there needs to the blank line between paragraphs.

When you paste back into LO. Did you use 'Paste Special'?
Try 'Paste Special' <Ctrl>+<Shift>+V and select 'Unformatted Text'

cK

That won't help because the end-of-line indication is part of the
structure, not the format of the document.

I'm afraid the only way I've ever found to solve this problem is to put a
second hard return at the end of each paragraph, do a find and replace of a
double hard return, replacing it with QQQ (or some other unlikely to occur
character sequence), then doing a find and replace of single hard returns,
replacing them with nothing, then doing a find and replace on QQQ,
replacing the placeholder characters with hard returns. It's a lot of
manual work, but it works.

jomali

I have a hundreds of paragraphs that need to be fixed so that they fit the width of the pages in which they are located. Presently, the paragraphs are about 4" wide and all have the "non-printing character" at the end of each text line that looks like a backward letter P with a line next to it.

In other words, each line is actually a separate paragraph.

Is there a quick way to get rid of this problem?

Yes.

o Go to Tools | AutoCorrect Options... | Options, and tick "Combine single line paragraphs if length greater than 50%".
o Go to Format | AutoCorrect > | Apply.

Notes:

o You may need to reduce that value of 50% to make the facility work properly in your case. Click on the text of the option and the Edit... button below will light up and enable you to edit the 50% value to a suitable smaller one.

o How are your real paragraph breaks indicated in your text? There will need to be consecutive paragraph marks to show these if you are not to end up with a single enormous paragraph, of course. (This will mean that the text has an empty paragraph between each pair of real paragraphs - though you may think of these as "blank lines".) If you need to add these, you may find it easier to do so first.

o Applying AutoCorrect will make other changes to your text - which you may not want. You can avoid this in two ways: either switch off unwanted changes in the AutoCorrect dialogue or - more easily - use Format | AutoCorrect > | Apply and Edit Changes instead. Then choose Edit Changes when challenged. Now click the Comment column header in the Accept or Reject AutoFormat Changes panel; this sorts all the changes of a particular type together. Select all the "Combine paragraphs" lines together (using Shift-click or Shift-arrow in the usual way) and click Accept. Now click Reject All to reject all other changes.

I trust this helps.

Brian Barker

Hi all

Here is another solution from the LibreOffice guru Regina Henschel posted
some time ago (and saved in my bookmarks)
This should be in some FAQ (if seh hasn't wrote one herself already) :slight_smile:

Regina Henschel wrote

Hi all,

Tom Davies schrieb:

Hi :slight_smile:

I'm surprised there doesn't seem to be an easier way to do
find&replace for the paragraph mark!

Check "regular expressions" in the "More Options" part.
Search for $
Replace with blank
Click on "Replace all"

Kind regards
Regina

HTH
Pedro

Hi :slight_smile:
I think the main problem this time is NOT removing the ones that are needed.  However it was good to point to Regina's post to get rid of the bulk of the extra ones that need to be removed.
Regards from
Tom :slight_smile:

Hi :slight_smile:
Wow!!  Again!  LibreOffice has some pretty awesome features.  I guess MS Office does too but they don't have Brian Barker or Regina (or Pedro, Alex, Cor ... and so on and on) on their help lists.
Regards from
Tom :slight_smile:

On Fri, 10 Feb 2012 04:15:21 +0000, Brian Barker
<b.m.barker@btinternet.com> wrote Re Re: [libreoffice-users] Paragraph
format problem:

o Go to Tools | AutoCorrect Options... | Options, and tick "Combine
single line paragraphs if length greater than 50%".

Just curious: "If length greater than 50%" of what?

Caesar wrote (10-02-12 14:31)

Just curious: "If length greater than 50%" of what?

Of available width, I would guess.

Tom wrote

I think the main problem this time is NOT removing the ones that are
needed.  However it was good to point to Regina's post to get rid of the
bulk of the extra ones that need to be removed.

That is the easy part. Although I think the only way to solve it is manually
(someone please correct me if I'm wrong). If the user manually adds an extra
paragraph return (i.e. there will be an empty line just with a pilcrow)
between real paragraphs when the Find & Replace is run, it will delete all
the single paragraph marks and keep the second paragraph mark (because it's
a single pass filter :wink: )

HTH,
Pedro

wrote Re Re: [libreoffice-users] Paragraph format problem:

Caesar wrote (10-02-12 14:31)

Just curious: "If length greater than 50%" of what?

Of available width, I would guess.

Well duh, that makes sense. Now I need to go bang my head against the
wall to get my brain moving again :slight_smile:

Thanks, everyone, for trying to help. In the end Find/Replace was used
with the "$" and "\n" options and some other fancy stuff.

Total replacements were for 24,000 lines or so. It took about a
minute....but it got done.

Ain't nothin' easy, though.

Caesar wrote (10-02-12 17:25)

Well duh, that makes sense. Now I need to go bang my head against the
wall to get my brain moving again :slight_smile:

Ah well, pls take care that you do not damage the wall :wink: