• Can anyone help with this?

    Author
    Topic
    #469266

    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?

    Viewing 1 reply thread
    Author
    Replies
    • #1226375

      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.

      • #1226416

        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.

    • #1226440

      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.

      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/index.php?app=core&module=usercp&hl=true

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

      Find — OOo paragraph marks:

      Code:
      $$

      or

      Find — OOo newlines:

      Code:
      nn

      Replace:

      Code:
      n

      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 
      • #1234498

        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:
        nn

        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).)

    Viewing 1 reply thread
    Reply To: Can anyone help with this?

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: