Quantcast

deleting hard returns

classic Classic list List threaded Threaded
24 messages Options
12
poemblaze poemblaze
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

deleting hard returns

Help! I am wanting to delete hard returns that were placed at the end of every line of a large document. All I've seen is how to delete a paragraph (hard) return in a blank paragraph. I'd also like to convert hard returns to soft returns in a couple places. That is the opposite action of what I've seen explained elsewhere. Any help would be appreciated.
Pedro Pedro
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns

If your file contains plain text you can "easily" fix that with an advanced text editor like Notepad2-mod.

However if the text is formatted it requires some LibreOffice function that I'm not aware of but would be interested to learn :)

Anyone?
Mirosław Zalewski Mirosław Zalewski
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns

In reply to this post by poemblaze
On 28/11/2011 at 03:32, poemblaze <[hidden email]> wrote:

> Help! I am wanting to delete hard returns that were placed at the end of
> every line of a large document. All I've seen is how to delete a paragraph
> (hard) return in a blank paragraph.

If by "hard return" you mean Shift+Enter, it's pretty easy:
1. Open find and replace dialog (by default it is Ctrl+Alt+F in LO 3.4).
2. In "More options" check "Regular expressions".
3. Search for "\n" (backslash and n).
4. Click "Replace all" (don't enter any replacement string).

That's it. All hard returns disappear.

> I'd also like to convert hard returns
> to soft returns in a couple places. That is the opposite action of what
> I've seen explained elsewhere.

With "Regular expression" you can search for "\n" and replace it with "\n"
(backslash n again). This will convert hard return to soft return
(if I understand these words correctly).

The tricky part is to tell LO which hard returns you want to delete and which
converted to soft return. I can think of one way:
at beginning of line after hard return you want converted to soft return,
place some character, like "ß" (German scharfes S - if your document isn't in
German, it's unlikely that you have it anywhere in it), and then search for
"\nß" and replace it with "\n". Now search for "\n" and replace it with
nothing in order to delete unwanted hard returns.

HTH.
--
Best regards
Mirosław Zalewski

--
For unsubscribe instructions e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
e-letter e-letter
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns

In reply to this post by poemblaze
On 28/11/2011, poemblaze <[hidden email]> wrote:
> Help! I am wanting to delete hard returns that were placed at the end of
> every line of a large document. All I've seen is how to delete a paragraph
> (hard) return in a blank paragraph. I'd also like to convert hard returns to
> soft returns in a couple places. That is the opposite action of what I've
> seen explained elsewhere. Any help would be appreciated.
>

How do you delete a paragraph in a blank paragraph???

Suggest you learn about regular expressions. You could copy your text
into a text editor (everyone has a personal favourite: jedit).
Standard syntax to remove new lines is:

\n

within any standard 'find and replace' dialogue window in your text
editor. The syntax for regular expressions may not be as extensive in
LO, so read the manual ('list of regular expressions'). Not sure what
you mean by "soft returns" (new line?).

--
For unsubscribe instructions e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Tom Tom
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns

Hi :)

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

A text editor is likely to remove all the formatting.  One way around might be to open the file as a compressed folder.  

It's important to make a back-up copy of the file before starting to play around with this sort of thing!  (Just copy&paste the file into the same folder it's already in)

If you saved in docX or Odt then you can open the file with an archive manager or just rename the file-ending from .odt to .zip.  Then use the text-editor to edit the file "contents.xml".  I don't know how radically you can play around with that file so do a quick test before spending too much time on it.  

Many text-editors such as SciTe, gedit, kate and so on allow you to view text as html/css, mxl.  Often either in the View menu or on the status-bar at the bottom.  Look for where it says "Plain text" and click on that.  The text-editor then cleverly works out which parts of the text are coding and colours it = colour coding the xml-coding!

Sorry i couldn't find a more straight-forwards answer!
Apols and regards from
Tom :)


--- On Mon, 28/11/11, e-letter <[hidden email]> wrote:

> From: e-letter <[hidden email]>
> Subject: Re: [libreoffice-users] deleting hard returns
> To: [hidden email]
> Date: Monday, 28 November, 2011, 10:43
> On 28/11/2011, poemblaze <[hidden email]>
> wrote:
> > Help! I am wanting to delete hard returns that were
> placed at the end of
> > every line of a large document. All I've seen is how
> to delete a paragraph
> > (hard) return in a blank paragraph. I'd also like to
> convert hard returns to
> > soft returns in a couple places. That is the opposite
> action of what I've
> > seen explained elsewhere. Any help would be
> appreciated.
> >
>
> How do you delete a paragraph in a blank paragraph???
>
> Suggest you learn about regular expressions. You could copy
> your text
> into a text editor (everyone has a personal favourite:
> jedit).
> Standard syntax to remove new lines is:
>
> \n
>
> within any standard 'find and replace' dialogue window in
> your text
> editor. The syntax for regular expressions may not be as
> extensive in
> LO, so read the manual ('list of regular expressions'). Not
> sure what
> you mean by "soft returns" (new line?).
>
> --
> For unsubscribe instructions e-mail to: [hidden email]
> Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> List archive: http://listarchives.libreoffice.org/global/users/
> All messages sent to this list will be publicly archived
> and cannot be deleted
>

--
For unsubscribe instructions e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Tom Tom
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns

In reply to this post by Mirosław Zalewski
Hi :)
The \n doesn't seem to work in Writer 3.3.2.  But there has to be something like that, some mark to show a hard-carriage return.  Knowing what it is would make this easier!
Regards from
Tom :)


--- On Mon, 28/11/11, Mirosław Zalewski <[hidden email]> wrote:

> From: Mirosław Zalewski <[hidden email]>
> Subject: Re: [libreoffice-users] deleting hard returns
> To: [hidden email]
> Date: Monday, 28 November, 2011, 10:21
> On 28/11/2011 at 03:32, poemblaze
> <[hidden email]>
> wrote:
>
> > Help! I am wanting to delete hard returns that were
> placed at the end of
> > every line of a large document. All I've seen is how
> to delete a paragraph
> > (hard) return in a blank paragraph.
>
> If by "hard return" you mean Shift+Enter, it's pretty
> easy:
> 1. Open find and replace dialog (by default it is
> Ctrl+Alt+F in LO 3.4).
> 2. In "More options" check "Regular expressions".
> 3. Search for "\n" (backslash and n).
> 4. Click "Replace all" (don't enter any replacement
> string).
>
> That's it. All hard returns disappear.
>
> > I'd also like to convert hard returns
> > to soft returns in a couple places. That is the
> opposite action of what
> > I've seen explained elsewhere.
>
> With "Regular expression" you can search for "\n" and
> replace it with "\n"
> (backslash n again). This will convert hard return to soft
> return
> (if I understand these words correctly).
>
> The tricky part is to tell LO which hard returns you want
> to delete and which
> converted to soft return. I can think of one way:
> at beginning of line after hard return you want converted
> to soft return,
> place some character, like "ß" (German scharfes S - if
> your document isn't in
> German, it's unlikely that you have it anywhere in it), and
> then search for
> "\nß" and replace it with "\n". Now search for "\n" and
> replace it with
> nothing in order to delete unwanted hard returns.
>
> HTH.
> --
> Best regards
> Mirosław Zalewski
>
> --
> For unsubscribe instructions e-mail to: [hidden email]
> Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> List archive: http://listarchives.libreoffice.org/global/users/
> All messages sent to this list will be publicly archived
> and cannot be deleted
>

--
For unsubscribe instructions e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Gene Young Gene Young
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns

On 11/28/2011 7:44 AM, Tom Davies wrote:
> Hi :)
> The \n doesn't seem to work in Writer 3.3.2.  But there has to be something like that, some mark to show a hard-carriage return.  Knowing what it is would make this easier!
> Regards from
> Tom :)
>

You have to search using regular expressions.  Its in the help files.


--

Gene Young
Researching Young, Harer, Cox & Sallada
With Legacy Family Tree
http://myyoungs.atspace.com/index.htm

--
For unsubscribe instructions e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Pedro Pedro
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns

In reply to this post by Tom
Hi Tom and e-letter

I think you both missed step number 2 in Miroslaw's answer

> 2. In "More options" check "Regular expressions".

Although this is not quite user friendly, it works perfectly and it is good to know that LO has this feature.

I'm keeping this one on my personal Tips and Tricks list ;)

Thank you, Miroslaw!
Bob Houston Bob Houston
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns


Hi to all,
I use ^p to designate paragraph returns in LO and I think it works in MS Word as well.  I have a need to remove blank lines (empty paragraphs) from time to time.
I search for ^p^p and replace with ^p (the ^ (caret) is above the 6 ).
I'm not sure what a 'soft return' is, but to take out the hard return and just let the text flow, I search for ^p and replace with ' ' (one blank) assuming there was no blanks after the .  before the hard return.  If you need to take out tabs ^t will work.
 Bob
Bob Houston eBook Formattinghttp://about.me/BobHouston
http://facebook.com/eBookFormatting


> Date: Mon, 28 Nov 2011 05:47:41 -0800
> From: [hidden email]
> To: [hidden email]
> Subject: [libreoffice-users] Re: deleting hard returns
>
> Hi Tom and e-letter
>
> I think you both missed step number 2 in Miroslaw's answer
>
> > 2. In "More options" check "Regular expressions".
>
> Although this is not quite user friendly, it works perfectly and it is good
> to know that LO has this feature.
>
> I'm keeping this one on my personal Tips and Tricks list ;)
>
> Thank you, Miroslaw!
>
> --
> View this message in context: http://nabble.documentfoundation.org/deleting-hard-returns-tp3541244p3542232.html
> Sent from the Users mailing list archive at Nabble.com.
>
> --
> For unsubscribe instructions e-mail to: [hidden email]
> Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> List archive: http://listarchives.libreoffice.org/global/users/
> All messages sent to this list will be publicly archived and cannot be deleted
>
     
--
For unsubscribe instructions e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

jomali jomali
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns

I'd suggest that, before giving advice, people actually try what they are
suggesting.

In OOo and LO, unlike MSO, paragraphs are designated by surrounding the
text with <p></p> symbols (like html). As a result, there is no "paragraph
mark" to search for, and using either ^p or \n in the search field will
give you a "search key not found" error.

On the other hand, if you ended a line with a Shift-enter, no new paragraph
is created. Instead, a \n symbol is inserted into the text. If you enable
regular expressions and put a \n in the find field, the \n will be found
and can be replaced by anything you like (including nothing).

There is no way I've ever found in OOo or LO to use ^p in the search field.
^p works in every version of MSO I've tried, but not in LO.

I verified what I'm saying by actually trying it in LO 3.4.3

jomali

On Mon, Nov 28, 2011 at 9:55 AM, Bob Houston <[hidden email]>wrote:

>
> Hi to all,
> I use ^p to designate paragraph returns in LO and I think it works in MS
> Word as well.  I have a need to remove blank lines (empty paragraphs) from
> time to time.
> I search for ^p^p and replace with ^p (the ^ (caret) is above the 6 ).
> I'm not sure what a 'soft return' is, but to take out the hard return and
> just let the text flow, I search for ^p and replace with ' ' (one blank)
> assuming there was no blanks after the .  before the hard return.  If you
> need to take out tabs ^t will work.
>  Bob
> Bob Houston eBook Formattinghttp://about.me/BobHouston
> http://facebook.com/eBookFormatting
>
>
> > Date: Mon, 28 Nov 2011 05:47:41 -0800
> > From: [hidden email]
> > To: [hidden email]
> > Subject: [libreoffice-users] Re: deleting hard returns
> >
> > Hi Tom and e-letter
> >
> > I think you both missed step number 2 in Miroslaw's answer
> >
> > > 2. In "More options" check "Regular expressions".
> >
> > Although this is not quite user friendly, it works perfectly and it is
> good
> > to know that LO has this feature.
> >
> > I'm keeping this one on my personal Tips and Tricks list ;)
> >
> > Thank you, Miroslaw!
> >
> > --
> > View this message in context:
> http://nabble.documentfoundation.org/deleting-hard-returns-tp3541244p3542232.html
> > Sent from the Users mailing list archive at Nabble.com.
> >
> > --
> > For unsubscribe instructions e-mail to:
> [hidden email]
> > Problems?
> http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> > Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> > List archive: http://listarchives.libreoffice.org/global/users/
> > All messages sent to this list will be publicly archived and cannot be
> deleted
> >
>
> --
> For unsubscribe instructions e-mail to: [hidden email]
> Problems?
> http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> List archive: http://listarchives.libreoffice.org/global/users/
> All messages sent to this list will be publicly archived and cannot be
> deleted
>
>

--
For unsubscribe instructions e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Jay Lozier Jay Lozier
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns

In reply to this post by Tom
On 11/28/2011 07:37 AM, Tom Davies wrote:

> Hi :)
>
> I'm surprised there doesn't seem to be an easier way to do find&replace for the paragraph mark!
>
> A text editor is likely to remove all the formatting.  One way around might be to open the file as a compressed folder.
>
> It's important to make a back-up copy of the file before starting to play around with this sort of thing!  (Just copy&paste the file into the same folder it's already in)
>
> If you saved in docX or Odt then you can open the file with an archive manager or just rename the file-ending from .odt to .zip.  Then use the text-editor to edit the file "contents.xml".  I don't know how radically you can play around with that file so do a quick test before spending too much time on it.
>
> Many text-editors such as SciTe, gedit, kate and so on allow you to view text as html/css, mxl.  Often either in the View menu or on the status-bar at the bottom.  Look for where it says "Plain text" and click on that.  The text-editor then cleverly works out which parts of the text are coding and colours it = colour coding the xml-coding!
>
> Sorry i couldn't find a more straight-forwards answer!
> Apols and regards from
> Tom :)
I think the problem is that in xml or html you can enter a CR in the
<p></p> tag that is ignored when displaying xml/html by a browser to
make the text easier to read while editing. The CR may cause other
programs to display the text incorrectly because they assume the CR is
an editing command that must be obeyed. Xml/html have a tag for
inserting a CR (<br />).

>
> --- On Mon, 28/11/11, e-letter<[hidden email]>  wrote:
>
>> From: e-letter<[hidden email]>
>> Subject: Re: [libreoffice-users] deleting hard returns
>> To: [hidden email]
>> Date: Monday, 28 November, 2011, 10:43
>> On 28/11/2011, poemblaze<[hidden email]>
>> wrote:
>>> Help! I am wanting to delete hard returns that were
>> placed at the end of
>>> every line of a large document. All I've seen is how
>> to delete a paragraph
>>> (hard) return in a blank paragraph. I'd also like to
>> convert hard returns to
>>> soft returns in a couple places. That is the opposite
>> action of what I've
>>> seen explained elsewhere. Any help would be
>> appreciated.
>> How do you delete a paragraph in a blank paragraph???
>>
>> Suggest you learn about regular expressions. You could copy
>> your text
>> into a text editor (everyone has a personal favourite:
>> jedit).
>> Standard syntax to remove new lines is:
>>
>> \n
>>
>> within any standard 'find and replace' dialogue window in
>> your text
>> editor. The syntax for regular expressions may not be as
>> extensive in
>> LO, so read the manual ('list of regular expressions'). Not
>> sure what
>> you mean by "soft returns" (new line?).
>>
>> --
>> For unsubscribe instructions e-mail to: [hidden email]
>> Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
>> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
>> List archive: http://listarchives.libreoffice.org/global/users/
>> All messages sent to this list will be publicly archived
>> and cannot be deleted
>>


--
Jay Lozier
[hidden email]


--
For unsubscribe instructions e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Bob Houston Bob Houston
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns

In reply to this post by jomali

Jomali, I stand corrected.  And thank you.  I receive the documents I work on in MSO '97, work on them in LO, and return as MSO '97 or HTML.  Sometimes, at my age, it's hard to remember where I'm at, let alone what editor I'm using.  Could also be why the last manuscript I worked on went back to the author with some blank lines still in it.  |:>(
I'll put this out, to add to the discussion.  I have found that when editing text documents (I use Notepad++) in the extended search mode, \r\n\r\n will find back to back hard returns (CRLF).  And I just did test it again.  |:>)
Bob

Bob Houston eBook Formattinghttp://about.me/BobHouston
http://facebook.com/eBookFormatting


> Date: Mon, 28 Nov 2011 11:00:28 -0500
> Subject: Re: [libreoffice-users] Re: deleting hard returns
> From: [hidden email]
> To: [hidden email]
>
> I'd suggest that, before giving advice, people actually try what they are
> suggesting.
>
> In OOo and LO, unlike MSO, paragraphs are designated by surrounding the
> text with <p></p> symbols (like html). As a result, there is no "paragraph
> mark" to search for, and using either ^p or \n in the search field will
> give you a "search key not found" error.
>
> On the other hand, if you ended a line with a Shift-enter, no new paragraph
> is created. Instead, a \n symbol is inserted into the text. If you enable
> regular expressions and put a \n in the find field, the \n will be found
> and can be replaced by anything you like (including nothing).
>
> There is no way I've ever found in OOo or LO to use ^p in the search field.
> ^p works in every version of MSO I've tried, but not in LO.
>
> I verified what I'm saying by actually trying it in LO 3.4.3
>
> jomali
>
> On Mon, Nov 28, 2011 at 9:55 AM, Bob Houston <[hidden email]>wrote:
>
> >
> > Hi to all,
> > I use ^p to designate paragraph returns in LO and I think it works in MS
> > Word as well.  I have a need to remove blank lines (empty paragraphs) from
> > time to time.
> > I search for ^p^p and replace with ^p (the ^ (caret) is above the 6 ).
> > I'm not sure what a 'soft return' is, but to take out the hard return and
> > just let the text flow, I search for ^p and replace with ' ' (one blank)
> > assuming there was no blanks after the .  before the hard return.  If you
> > need to take out tabs ^t will work.
> >  Bob
> > Bob Houston eBook Formattinghttp://about.me/BobHouston
> > http://facebook.com/eBookFormatting
> >
> >
> > > Date: Mon, 28 Nov 2011 05:47:41 -0800
> > > From: [hidden email]
> > > To: [hidden email]
> > > Subject: [libreoffice-users] Re: deleting hard returns
> > >
> > > Hi Tom and e-letter
> > >
> > > I think you both missed step number 2 in Miroslaw's answer
> > >
> > > > 2. In "More options" check "Regular expressions".
> > >
> > > Although this is not quite user friendly, it works perfectly and it is
> > good
> > > to know that LO has this feature.
> > >
> > > I'm keeping this one on my personal Tips and Tricks list ;)
> > >
> > > Thank you, Miroslaw!
> > >
> > > --
> > > View this message in context:
> > http://nabble.documentfoundation.org/deleting-hard-returns-tp3541244p3542232.html
> > > Sent from the Users mailing list archive at Nabble.com.
> > >
> > > --
> > > For unsubscribe instructions e-mail to:
> > [hidden email]
> > > Problems?
> > http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> > > Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> > > List archive: http://listarchives.libreoffice.org/global/users/
> > > All messages sent to this list will be publicly archived and cannot be
> > deleted
> > >
> >
> > --
> > For unsubscribe instructions e-mail to: [hidden email]
> > Problems?
> > http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> > Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> > List archive: http://listarchives.libreoffice.org/global/users/
> > All messages sent to this list will be publicly archived and cannot be
> > deleted
> >
> >
>
> --
> For unsubscribe instructions e-mail to: [hidden email]
> Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> List archive: http://listarchives.libreoffice.org/global/users/
> All messages sent to this list will be publicly archived and cannot be deleted
>
     
--
For unsubscribe instructions e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

John McAtee John McAtee
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns

In reply to this post by Bob Houston
I know that ^p works in MS Word but it does not work in LO 3.4.3 with regular expression turned on or without.

The help discusses removing the Line break that is entered with the Shift+Enter and replacing with a hard return as if the enter key was pressed but there is no discussion of which regular expression works to find the end of paragraph marker that may be at the end of each line of text copied from a webpage and pasted into a Writer document.

Interesting question.

John McAtee




>________________________________
> From: Bob Houston <[hidden email]>
>To: Users Global.libreoffice.org <[hidden email]>
>Sent: Monday, November 28, 2011 9:55 AM
>Subject: RE: [libreoffice-users] Re: deleting hard returns
>
>
>Hi to all,
>I use ^p to designate paragraph returns in LO and I think it works in MS Word as well.  I have a need to remove blank lines (empty paragraphs) from time to time.
>I search for ^p^p and replace with ^p (the ^ (caret) is above the 6 ).
>I'm not sure what a 'soft return' is, but to take out the hard return and just let the text flow, I search for ^p and replace with ' ' (one blank) assuming there was no blanks after the .  before the hard return.  If you need to take out tabs ^t will work.
>Bob
>Bob Houston eBook Formattinghttp://about.me/BobHouston
>http://facebook.com/eBookFormatting
>
>
>> Date: Mon, 28 Nov 2011 05:47:41 -0800
>> From: [hidden email]
>> To: [hidden email]
>> Subject: [libreoffice-users] Re: deleting hard returns
>>
>> Hi Tom and e-letter
>>
>> I think you both missed step number 2 in Miroslaw's answer
>>
>> > 2. In "More options" check "Regular expressions".
>>
>> Although this is not quite user friendly, it works perfectly and it is good
>> to know that LO has this feature.
>>
>> I'm keeping this one on my personal Tips and Tricks list ;)
>>
>> Thank you, Miroslaw!
>>
>> --
>> View this message in context: http://nabble.documentfoundation.org/deleting-hard-returns-tp3541244p3542232.html
>> Sent from the Users mailing list archive at Nabble.com.
>>
>> --
>> For unsubscribe instructions e-mail to: [hidden email]
>> Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
>> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
>> List archive: http://listarchives.libreoffice.org/global/users/
>> All messages sent to this list will be publicly archived and cannot be deleted
>>
>                         
>--
>For unsubscribe instructions e-mail to: [hidden email]
>Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
>Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
>List archive: http://listarchives.libreoffice.org/global/users/
>All messages sent to this list will be publicly archived and cannot be deleted
>
>
>
>
--
For unsubscribe instructions e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

e-letter e-letter
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns

In reply to this post by Pedro
On 28/11/2011, Pedro <[hidden email]> wrote:
> Hi Tom and e-letter
>
> I think you both missed step number 2 in Miroslaw's answer

The reason for this is that the option is always selected manually! :)
>
>> 2. In "More options" check "Regular expressions".
>
> Although this is not quite user friendly, it works perfectly and it is good
> to know that LO has this feature.

Agreed, it would be good if LO saved the option chosen from the last
time the dialogue window was opened (as occurs in a text editor). If
this worthy of a bug notification?

--
For unsubscribe instructions e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Regina Henschel Regina Henschel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns

In reply to this post by Tom
Hi all,

Tom Davies schrieb:
> Hi :)
>
> 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

--
For unsubscribe instructions e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Mirosław Zalewski Mirosław Zalewski
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns

In reply to this post by e-letter
On 28/11/2011 at 22:15, "e-letter" <[hidden email]> wrote:

> Agreed, it would be good if LO saved the option chosen from the last
> time the dialogue window was opened (as occurs in a text editor). If
> this worthy of a bug notification?

Maybe you mean some specific circumstances, but my Writer *does* remember
regular expression checkbox state. If I checked it, it will be checked next
time I open search and replace dialog. It will work even if I shut down LO in
between!

It does not remember search strings, though.

I am using LO 3.4.3 from Debian testing repositories on amd64 machine.
--
Best regards
Mirosław Zalewski

--
For unsubscribe instructions e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Mirosław Zalewski Mirosław Zalewski
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns

In reply to this post by John McAtee
On 28/11/2011 at 20:49, John McAtee <[hidden email]> wrote:

> but there is no discussion of which regular expression works to find the
> end of paragraph marker that may be at the end of each line of text copied
> from a webpage and pasted into a Writer document.

Do you mean $ (dollar sign)?

It is described in online help:
<http://help.libreoffice.org/Common/List_of_Regular_Expressions>.
--
Best regards
Mirosław Zalewski

--
For unsubscribe instructions e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Dennis E. Hamilton Dennis E. Hamilton
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns

In reply to this post by poemblaze
If the regular-expression technique given in later replies works, that's
terrific.  If not, there is another way to make it happen by digging into
the ODT (if that is the document you have).

MINING THE ODT

It is possible to remove all of the hard line breaks in an ODF text (Writer
ODT) document.

The main risk is loss of all paragraphing too.  If the document is entirely
formatted using hard line breaks, paragraphing by insertion of extra line
breaks (blank lines) will also be lost.

It takes some surgery on the document.

 1. Use a Zip utility to open A WORKING COPY of the *.odt file.  (Rename it
*.odt.zip is one way to make this easy.)

 2. Extract a copy of the file named content.xml.

 3. In a text editor do a search and delete (replace by nothing) of all
"<text:line-break/>" strings in the content.xml file.  (It is helpful if you
have a text editor that is XML friendly and doesn't show the document as if it
is all one line of text.  But it should work anyhow so long as the text editor
can handle a line that long [;<).

 4. Add the modified context.xml back into the Zip and close the Zip.

 5. Rename back to *.odt if needed.

 6. Open it in Writer and see if the paragraphs survived.  If not, decide how
badly you want to go through the document and add paragraph breaks using the
ENTER key where the breaks are needed.

ALTERNATIVES TO PLAYING IN THE ZIP

Another way, still requiring a text editor (not Writer), is to work on a
.txt file and bring the corrections back into Writer:

If (6) is really ugly, and the document is simple enough, the ODT can be saved as
text instead.  Use a text editor to replace every consecutive *pair* of line
endings with something absurd such as *nl*.  Then use the text editor to
replace all remaining line endings with a single space each.  Then use the
editor to replace each remaining *nl* (or what you used) with a line ending.
Now bring the .txt file back into Writer and save it as an ODT real fast.
There will still need to be cleanup.  For example, if any words were
hyphenated between lines, those will have to be repaired.

Even if the document has images and other decorations that make this
difficult, you might want to make a .txt version anyhow, and copy and paste
from the cleaned up text back into the better-formatted, more-complete
original.

Without seeing the original problem document, it is difficult to suggest
anything that might be even simpler.

 - Dennis


-----Original Message-----
From: Pedro [mailto:[hidden email]]
Sent: Sunday, November 27, 2011 23:42
To: [hidden email]
Subject: [libreoffice-users] Re: deleting hard returns

If your file contains plain text you can "easily" fix that with an advanced
text editor like Notepad2-mod.

However if the text is formatted it requires some LibreOffice function that
I'm not aware of but would be interested to learn :)

Anyone?

--
View this message in context:
http://nabble.documentfoundation.org/deleting-hard-returns-tp3541244p3541556.html
Sent from the Users mailing list archive at Nabble.com.

--
For unsubscribe instructions e-mail to: [hidden email]
Problems?
http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


--
For unsubscribe instructions e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Tom Tom
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns

In reply to this post by Regina Henschel
Hi :)
Regina's answer worked for me.  Just open the document as normal, not the messy way i described last time.  Then search for $ (= hard carriage return),  That does find the hard-returns.  I tried replacing with \n but it didn't work for me.  When i searched for \n it found all the soft-returns that i had made by using shift&enter
Regards from
Tom :)
John McAtee John McAtee
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: deleting hard returns

In reply to this post by Regina Henschel
Regina
 
Thank you.  That was the answer the original poster and I were looking for.
 
John McAtee


>________________________________
> From: Regina Henschel <[hidden email]>
>To: [hidden email]
>Sent: Monday, November 28, 2011 4:20 PM
>Subject: Re: [libreoffice-users] deleting hard returns
>
>Hi all,
>
>Tom Davies schrieb:
>> Hi :)
>>
>> 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
>
>--
>For unsubscribe instructions e-mail to: [hidden email]
>Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
>Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
>List archive: http://listarchives.libreoffice.org/global/users/
>All messages sent to this list will be publicly archived and cannot be deleted
>
>
>  
--
For unsubscribe instructions e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

12
Loading...