Results 1 to 5 of 5
  1. #1
    New Lounger rdanner3's Avatar
    Join Date
    May 2010
    Location
    AL
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    With Word 2000, several search and replace sets I do all the time read as follows:

    1. Deletes text of the format "[12:30:40] MSAPulsar: "
    in Find: [^#^#:^#^#:^#^#] ^?^?^?^?^?^?^?^?:
    Replace: (Left blank)

    2. Replaces two paragraph marks with one
    In Find: ^p^p
    Replace: ^p

    3. Replace two spaces with a non-breaking space and a space
    This one's used to force 2 spaces after a full-stop to actually visually display.
    Code:
    (In the below, the actual find and replace don't have quotation marks around 'em)
    In Find: "  "
    Replace: "^s "
    Maybe I'm just inexperienced in OpenOffice.org (aka OOo) but I can't seem to make any of these work in Writer. Recently, I managed to find help on how to search and replace underlining with italics in OOo, but it's a bit odd to someone not used to regular expressions. Have tried to code the regex for all of the above, to no result. Since some of my work is drafted on an IRC server, and the logs are time-stamped to the nearest minute (thus the first global search listed), this is an issue, since I really don't want to use Word for one or two things, when I've gotten used to ODT's small size.

    Can anyone assist?
    Mr. Raymond Danner III

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Unfortunately, Writer does not have the friendly representation of special characters that you have in Word, so I'm afraid you are stuck using regular expressions to do this sort of thing. ODT may have a small footprint, but not the sophisticated tools.
    Wendell

  3. #3
    New Lounger rdanner3's Avatar
    Join Date
    May 2010
    Location
    AL
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by WendellB View Post
    Unfortunately, Writer does not have the friendly representation of special characters that you have in Word, so I'm afraid you are stuck using regular expressions to do this sort of thing. ODT may have a small footprint, but not the sophisticated tools.
    I am well aware of this. That's why I asked for help to figure out what's needed to replace the stated Find and Replace instances with their OOo equivalents, if indeed there ARE. Right now, my workaround is a true kludge; I first open the log in Word, do the S&R(s), then save it as a DOC file. I then reopen the DOC in OOo, saving it as ODT, then delete the DOC file. "Kludge" is almost a compliment for this sort of thing.

    I'd prefer to not have to use Microsoft Office at all, especially since Win7 doesn't play nice with certain aspects of Office 2000, which is the only version I own.
    Mr. Raymond Danner III

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    I figured I would take a guess at this. I had to uninstall OpenOffice.org a while ago to recover disk space, so I'll have to depend on you to test.

    Quote Originally Posted by Raymond Danner View Post
    1. Deletes text of the format "[12:30:40] MSAPulsar: "
    in Find: [^#^#:^#^#:^#^#] ^?^?^?^?^?^?^?^?:
    Replace: (Left blank)
    Find:
    Code:
    \[[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\] .{9}:
    (Note: I used {9} because MSAPulsar has 9 characters. If you need to match a variable number of characters, other than the colon, the regular expression would need to change.)http://lounge.windowssecrets.com/ind...usercp&hl=true

    Quote Originally Posted by Raymond Danner View Post
    2. Replaces two paragraph marks with one
    In Find: ^p^p
    Replace: ^p
    Find -- OOo paragraph marks:
    Code:
    $$
    or

    Find -- OOo newlines:
    Code:
    \n\n
    Replace:
    Code:
    \n
    Quote Originally Posted by Raymond Danner View Post
    3. Replace two spaces with a non-breaking space and a space
    This one's used to force 2 spaces after a full-stop to actually visually display.
    Code:
    (In the below, the actual find and replace don't have quotation marks around 'em)
    In Find: "  "
    Replace: "^s "
    Find = 2 spaces
    Replace = unicode value of non-breaking space and one regular space:
    Code:
    \x00A0

  5. #5
    New Lounger rdanner3's Avatar
    Join Date
    May 2010
    Location
    AL
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jscher2000 View Post
    I figured I would take a guess at this. I had to uninstall OpenOffice.org a while ago to recover disk space, so I'll have to depend on you to test.


    Find:
    Code:
    \[[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\] .{9}:
    (Note: I used {9} because MSAPulsar has 9 characters. If you need to match a variable number of characters, other than the colon, the regular expression would need to change.)

    Find -- OOo paragraph marks:
    Code:
    $$
    or

    Find -- OOo newlines:
    Code:
    \n\n
    Replace:
    Code:
    \n

    Find = 2 spaces
    Replace = unicode value of non-breaking space and one regular space:
    Code:
    \x00A0
    Okay, those sound like they might work. Admittedly, it sounds a tad arcane, but seemingly all regular expressions are. Very slowly learning the ins and outs of OOo's regex, and this does seem to help. Of course, it would be handy if the folks who code the thing would create appropriate macros accessed in a way similar to Word's. It'd save a lot of grief.

    I'm a computer repair tech and OOo leaves me scratching my head at the weirdest times. (BTW: Most versions of Office are far larger than OOo... And much, much more expensive)

    I write a fair amount, and OOo has simply worked, except for specialized cases like these. Will have to try the ideas, see which work. (though I think the last two would work, based on a rather convoluted situation I found myself in due to a change in the Standard Manuscript Format (which ain't quite so standardized).)
    Mr. Raymond Danner III

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •