Johnny Rosenberg wrote:

> 2009/8/20 Harold Fuchs <[email protected]>:
>> 2009/8/20 Jonathan Kaye <[email protected]>
>>
>>> Hi all,
>>> I've written a very clunky macro for reducing all sequences of spaces >
>>> 1 to
>>> a single space. It is a find/replace loop finds a sequence of 2 spaces
>>> and reduces it to 1 and then loops back to the beginning and repeats
>>> 10x. I do this 10 times since I don't know the maximum number of spaces
>>> that I'll need to deal with. This works fine for short documents but
>>> looping repeatedly through a 430 page document seems extreme. Sure
>>> there's some really cool code out there that will just take an arbitrary
>>> number of spaces greater than 1 and reduce them to a single space.
>>>
>>> All suggestions are welcome.
>>> TIA
>>> Jonathan
>>
>>
>> In the Find & Replace dialogue click "More options" and then check
>> Regular Expressions. Now, in the Find box, enter "  *" without the
>> quotes. That is 2 spaces followed by an asterisk. Enter a single space
>> into the "Replace with" box and click "Replace all". That should do it.
>> What you have done is replaced "a single space followed by zero or more
>> spaces" with "a single space". Read up about Regular Expressions for
>> details. Your time doing that will be well spent :-)
>>
>>
> 
> And then it's pretty easy to write a macro that runs the same thing
> with all the parameters pre set and assign that macro to a keyboard
> shortcut or an icon or whatever, making it possible to do this very
> easily, not having to open the search dialogue every time.
> 
> Johnny Rosenberg
Thanks very much Johnny. Yeah I agree. You'll see how I plan to do it in my
reply to Harold. The bloody lack of \s in OO's set of regular expressions
misled me.
Cheers,
Jonathan
-- 
Registerd Linux user #445917 at http://counter.li.org/
Please do not send me copies of list mail. I read the lists. Thanks!


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to