Re-flow text in Writer

classic Classic list List threaded Threaded
9 messages Options
Jason Jason
Reply | Threaded
Open this post in threaded view
|

Re-flow text in Writer

Hi,

Is there a way to force text to reflow in Writer?

Say I have a file with hard wraps at the end of each line and I want to
reflow all the paragraphs. Or alternately is there a way to find and
replace line breaks (searching for '\n' does not seem to work)?

Thanks,
--
Jason

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Peter Hillier-Brook Peter Hillier-Brook
Reply | Threaded
Open this post in threaded view
|

Re: Re-flow text in Writer

On 17/04/2020 00:00, Jason wrote:
> Hi,
>
> Is there a way to force text to reflow in Writer?

Yes.

> Say I have a file with hard wraps at the end of each line and I want to
> reflow all the paragraphs. Or alternately is there a way to find and
> replace line breaks (searching for '\n' does not seem to work)?

A simple search "replace line breaks Libre Office" should help. It
produced a multitude of useful answers via duckduckgo.

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
steveedmonds steveedmonds
Reply | Threaded
Open this post in threaded view
|

Re: Re-flow text in Writer

Also not long ago in this list if you can search this.
steve

On 17/04/2020 12:55, Peter Hillier-Brook wrote:

> On 17/04/2020 00:00, Jason wrote:
>> Hi,
>>
>> Is there a way to force text to reflow in Writer?
> Yes.
>
>> Say I have a file with hard wraps at the end of each line and I want to
>> reflow all the paragraphs. Or alternately is there a way to find and
>> replace line breaks (searching for '\n' does not seem to work)?
> A simple search "replace line breaks Libre Office" should help. It
> produced a multitude of useful answers via duckduckgo.
>


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
steveedmonds steveedmonds
Reply | Threaded
Open this post in threaded view
|

Re: Re-flow text in Writer



On 17/04/2020 13:19, Steve Edmonds wrote:
> Also not long ago in this list if you can search this.
> steve
27 March

>
> On 17/04/2020 12:55, Peter Hillier-Brook wrote:
>> On 17/04/2020 00:00, Jason wrote:
>>> Hi,
>>>
>>> Is there a way to force text to reflow in Writer?
>> Yes.
>>
>>> Say I have a file with hard wraps at the end of each line and I want to
>>> reflow all the paragraphs. Or alternately is there a way to find and
>>> replace line breaks (searching for '\n' does not seem to work)?
>> A simple search "replace line breaks Libre Office" should help. It
>> produced a multitude of useful answers via duckduckgo.
>>


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Brian Barker Brian Barker
Reply | Threaded
Open this post in threaded view
|

Re: Re-flow text in Writer

In reply to this post by Jason
At 18:00 16/04/2020 -0500, Jason Noname wrote:
>Is there a way to force text to reflow in Writer?

Text reflows automatically.

>Say I have a file with hard wraps at the end of each line and I want
>to reflow all the paragraphs.

You mean that you want to *join* existing paragraphs, so that the
entire (selected) text becomes a single paragraph?

o Search for $ .
o Replace with nothing.
You will need to have "Regular expressions" ticked, of course.

This will do exactly what you ask, so that paragraphs are joined
without anything in between. In practice, you may wish to replace
with a single space instead of nothing.

Note that if you have empty paragraphs in your text, these will be
removed - but they will prevent paragraphs preceding and following
them from being merged. You could merely repeat the same Find &
Replace, but that will duplicate the spaces, if you have included
them. Instead, first replace $ with space and then replace $ with nothing.

>Or alternately is there a way to find and replace line breaks
>(searching for '\n' does not seem to work)?

This is not an alternative to your other question but a different
requirement. If you indeed have line breaks, \n will match them. But
paragraph breaks are not line breaks, and \n will not match paragraph breaks.

I trust this helps.

Brian Barker


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Jason Jason
Reply | Threaded
Open this post in threaded view
|

Re: Re-flow text in Writer

In reply to this post by steveedmonds
On Fri, Apr 17, 2020 at 01:20:55PM +1200, Steve Edmonds composed:
>
>
> On 17/04/2020 13:19, Steve Edmonds wrote:
> > Also not long ago in this list if you can search this.
> > steve
> 27 March

Sorry, I had should have thoroughly read that thread before asking the
question. Search for $ and replace with space seems to be the solution.

Thanks,
--
Jason


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Jason Jason
Reply | Threaded
Open this post in threaded view
|

Re: Re-flow text in Writer

In reply to this post by Brian Barker
On Fri, Apr 17, 2020 at 02:58:12AM +0100, Brian Barker composed:

> At 18:00 16/04/2020 -0500, Jason Noname wrote:
> > Is there a way to force text to reflow in Writer?
>
> Text reflows automatically.
>
> > Say I have a file with hard wraps at the end of each line and I want to
> > reflow all the paragraphs.
>
> You mean that you want to *join* existing paragraphs, so that the entire
> (selected) text becomes a single paragraph?

I suppose that's what I wanted, I just didn't quite know how to ask the
question because the problematic document had multiple text sections
(separated by an empty line) which should have been paragraphs but each
line ended with a 'carriage return'; what I needed was to eliminate the
'carriage returns' (I guess properly called paragraph breaks) within
those text sections. Basically, converting each text section to a proper
paragraph.
 

> o Search for $ .
> o Replace with nothing.
> You will need to have "Regular expressions" ticked, of course.
>
> This will do exactly what you ask, so that paragraphs are joined without
> anything in between. In practice, you may wish to replace with a single
> space instead of nothing.
>
> Note that if you have empty paragraphs in your text, these will be removed -
> but they will prevent paragraphs preceding and following them from being
> merged. You could merely repeat the same Find & Replace, but that will
> duplicate the spaces, if you have included them. Instead, first replace $
> with space and then replace $ with nothing.

Searching for $ and replacing with space works, except that I have to do
it selectively on each section--doing Replace All on the whole document
lumps everything into one giant paragraph.
>
> > Or alternately is there a way to find and replace line breaks (searching
> > for '\n' does not seem to work)?
>
> This is not an alternative to your other question but a different
> requirement. If you indeed have line breaks, \n will match them. But
> paragraph breaks are not line breaks, and \n will not match paragraph
> breaks.
>
Okay, I guess I didn't understand the difference between line breaks and
paragraph breaks; the ones I was interested in were the ones created by
pressing Enter.

> I trust this helps.

It does, thank you.

--
Jason


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

steveedmonds steveedmonds
Reply | Threaded
Open this post in threaded view
|

Re: Re-flow text in Writer

Hi.

On 17/04/2020 15:04, Jason wrote:

> On Fri, Apr 17, 2020 at 02:58:12AM +0100, Brian Barker composed:
>> At 18:00 16/04/2020 -0500, Jason Noname wrote:
>>> Is there a way to force text to reflow in Writer?
>> Text reflows automatically.
>>
>>> Say I have a file with hard wraps at the end of each line and I want to
>>> reflow all the paragraphs.
>> You mean that you want to *join* existing paragraphs, so that the entire
>> (selected) text becomes a single paragraph?
> I suppose that's what I wanted, I just didn't quite know how to ask the
> question because the problematic document had multiple text sections
> (separated by an empty line) which should have been paragraphs but each
> line ended with a 'carriage return'; what I needed was to eliminate the
> 'carriage returns' (I guess properly called paragraph breaks) within
> those text sections. Basically, converting each text section to a proper
> paragraph.
>  
>> o Search for $ .
>> o Replace with nothing.
>> You will need to have "Regular expressions" ticked, of course.
>>
>> This will do exactly what you ask, so that paragraphs are joined without
>> anything in between. In practice, you may wish to replace with a single
>> space instead of nothing.
>>
>> Note that if you have empty paragraphs in your text, these will be removed -
>> but they will prevent paragraphs preceding and following them from being
>> merged. You could merely repeat the same Find & Replace, but that will
>> duplicate the spaces, if you have included them. Instead, first replace $
>> with space and then replace $ with nothing.
> Searching for $ and replacing with space works, except that I have to do
> it selectively on each section--doing Replace All on the whole document
> lumps everything into one giant paragraph.
If there are multiple line breaks between your sections you can get what
you want in 3 passes.
Replace $$ with *-* say (assuming *-* isn't in your text).
Replace $ with "" globally.
Replace *-* with \n

There is bound to be a more elegant solution.

>>> Or alternately is there a way to find and replace line breaks (searching
>>> for '\n' does not seem to work)?
>> This is not an alternative to your other question but a different
>> requirement. If you indeed have line breaks, \n will match them. But
>> paragraph breaks are not line breaks, and \n will not match paragraph
>> breaks.
>>
> Okay, I guess I didn't understand the difference between line breaks and
> paragraph breaks; the ones I was interested in were the ones created by
> pressing Enter.
>
>> I trust this helps.
> It does, thank you.
>


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Jason Jason
Reply | Threaded
Open this post in threaded view
|

Re: Re-flow text in Writer

On Fri, Apr 17, 2020 at 03:49:47PM +1200, Steve Edmonds composed:

> If there are multiple line breaks between your sections you can get what
> you want in 3 passes.
> Replace $$ with *-* say (assuming *-* isn't in your text).
> Replace $ with "" globally.
> Replace *-* with \n
>
> There is bound to be a more elegant solution.

In my case a slight variation of the above works:
Replace ^$ with *-*
Replace $ with space
Replace \*-\* (asterisks escaped) with \n

I'm getting the idea, thanks everyone.

--
Jason


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy