Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


At 11:08 07/10/2012 +0200, Johnny Rosenberg wrote:
2012/10/7 Brian Barker:
At 20:24 06/10/2012 -0400, Dan Lewis wrote:
 On 10/06/2012 05:09 PM, Cor Nouws wrote:
I was trying to use \t to replace e.g a paragraph ending with a tab. So find $ replace with \t That does not work.

At first I did not understand what you meant since paragraphs always end with paragraph breaks.

The questioner presumably wants to merge existing paragraphs: removing paragraph breaks and replacing them by tab characters.

Here is what I was able to do: In the search box, I entered .$ (period followed by the dollar sign). This searches paragraphs that end with a period.

Sorry, but that's not so. If "Regular expressions" is not ticked, then .$ matches exactly that: a dot followed by a dollar sign - nothing about paragraph breaks. If "Regular expressions" is ticked, then .$ matches any single character but only if it occurs at the end of a paragraph. But note in this latter case that the expression matches only that single character, without including the paragraph break itself. So any replacement replaces the single character but leaves the paragraph break as it was.

The $ sign anchors any search to the end of a paragraph, but does not match the paragraph break itself, which - in the view of LibreOffice's regular expressions - does not exist as a separate entity. There is no simple way to match and replace paragraph breaks, I think. (You can match and replace Shift+Enter line breaks - using \n.)

The problem I encountered was that the paragraph breaks was replaced with the characters "\t", not the [tab] (tab) character, no matter if "Regular expressions" were ticked or not. I got the same result when trying to replace with \x09: The paragraph breaks were replaced with the characters "\x09", not the [tab] character.

But maybe that's only me, I am not the OP, so feel free to ignore this.

Weirdly that's true: if you search for $ on its own, you can replace the paragraph breaks with something else. The problem is then only that "\t" in the "Replace with" box is interpreted as text instead of a regular expression. (Surely that's wrong?) But you've found the solution. (I spotted this part but didn't latch on to its significance.)

With "Regular expressions" ticked, first search for $ and replace with a character or string that does not occur in your document - perhaps a hash mark? Then repeat the search (still with "Regular expressions" ticked), this time searching for # and replacing with \t.

Sorry for previous distraction.  I trust this helps.

Brian Barker


--
For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
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

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.