Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] Replace spaces

Expand Messages
  • ezgoindm
    I use a series of 8 symbols as a delimiter when saving multiple messages in my newsgroup reader MY problem is that I can t get search/replace to find JUST 8
    Message 1 of 5 , Mar 2, 2001
    • 0 Attachment
      I use a series of 8 symbols as a delimiter when saving multiple messages in
      my newsgroup reader MY problem is that I can't get search/replace to find
      JUST 8 symbols as a "whole word" to change to the appropriate symbol (I
      changed from ======== to <<<<<<<<) It goes in and replaces the 8 piece
      string even in 20+ character strings So if someone used 20 "='s" as a
      divider beween story segments, it replaces 16 of em with "<'s".

      How do I limit search/replace to whole "word" instances of the search
      string? In other words:
      I want it to search and replace
      ========
      with
      <<<<<<<<

      NOT
      =====================
      with
      <<<<<<<<<<<<<<<<====



      ----- Original Message -----
      From: "Jody" <av1611@...>
      To: <ntb-clips@yahoogroups.com>
      Sent: Friday, March 02, 2001 3:53 PM
      Subject: Re: [Clip] Replace spaces


      > Hi Mark,
      >
      > >I'd imagine this question has been put many times before, but can
      > >anyone advise how to replace a sequence of three spaces with say
      > >two spaces in NTP?
      > >
      > >^!Replace " " >> " " does not appear to work!
      >
      > Try
      >
      > ^!Replace " " >> " " WAS
      >
      > which will do all of them *one pass* through the document.
      >
      > This will get all of them which will keep looping till no more
      > trip spaces are found:
      >
      > ^!Replace " " >> " " WAS
      > ^!IfError Next else Skip_-1
      >
      > Happy Clip'n!
      > Jody
      >
      > http://www.notetab.net
      >
      > Subscribe, UnSubscribe, Options
      > mailto:Ntb-Clips-Subscribe@yahoogroups.com
      > mailto:Ntb-Clips-UnSubscribe@yahoogroups.com
      > http://www.egroups.com/group/ntb-clips
      >
      >
      >
      >
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      >
      >
    • Jody
      Hi ezgoindm, That s a different name. ;) ... I do not know enough to tell if there is a quirk or not, but it appears there is or at least it could be improved.
      Message 2 of 5 , Mar 2, 2001
      • 0 Attachment
        Hi ezgoindm,

        That's a different name. ;)

        >I use a series of 8 symbols as a delimiter when saving multiple
        >messages in my newsgroup reader MY problem is that I can't get
        >search/replace to find JUST 8 symbols as a "whole word" to change
        >to the appropriate symbol (I changed from ======== to <<<<<<<<)
        >It goes in and replaces the 8 piece string even in 20+ character
        >strings So if someone used 20 "='s" as a divider beween story
        >segments, it replaces 16 of em with "<'s".
        >
        >How do I limit search/replace to whole "word" instances of the
        >search string?

        I do not know enough to tell if there is a quirk or not, but it
        appears there is or at least it could be improved. Help says:

        T: Does not search for whole words only (search string can be found
        within longer words).
        C: Searches for whole words only.
        If the options T or C are not used, NoteTab will search for whole
        words if the search criteria does not contain spaces or other
        word delimiting characters. If the search criteria contains such
        delimiters, then NoteTab will accept matches that are not whole
        words.

        So, it would appear that if the "C" Option was used, even with
        delimiters, that it would stop at, in your case, 8 equals signs.
        Checking Whole Words in the replace dialog should, I think, be
        equal to "C". Here is a work around for you though. I did not
        get real fancy so if you have say "========+" that will be
        replaced also, but nine or more equals signs will be ignored.
        NoteTab looks at the selection start for the column position.
        That is why it is checking the 9th character.

        ^!SetHintInfo Editing...
        ^!SetScreenUpdate Off
        ; ^!Replace "========" >> "<<<<<<<<" CS
        ; ^!IfError Next else Skip_-1
        :Loop
        ^!Find "========" S
        ^!IfError End
        ^!IfSame "=" "^$GetChar(+9)$" Loop
        ^!InsertText <<<<<<<<
        ^!Goto Loop

        If the "========" are all on one line you could use:

        ^!Replace "\n========\n" >> "\n<<<<<<<<\n" WARS

        A RegExp'ert will have to show you more than that. It is faster
        for me to write out a Clip than keep trying RegExp till I get it
        to work. ;)

        Happy Clip'n!
        Jody

        http://www.notetab.net

        Subscribe, UnSubscribe, Options
        mailto:Ntb-Clips-Subscribe@yahoogroups.com
        mailto:Ntb-Clips-UnSubscribe@yahoogroups.com
        http://www.egroups.com/group/ntb-clips
      • Ben Geyer
        To all newbies: Some time ago I got a copy of Jody s Tab2Spaces clip. I don t recall exactly where I got it, but it was from the internet somewhere. It had
        Message 3 of 5 , Mar 2, 2001
        • 0 Attachment
          To all newbies:

          Some time ago I got a copy of Jody's Tab2Spaces clip. I don't recall exactly
          where I got it, but it was from the internet somewhere.

          It had numerous errors when I tried to run it. When I finally got around to
          trouble shooting it I found that all of the errors were caused by just one extra
          space at the end of perhaps half a dozen lines. When these spaces (many were
          at the end of a label) were removed the clip ran just fine.

          The bottom line is to watch for superfluous spaces, especially in a clip imported
          from the 'net. - they can cause errors.

          Happy Tab'n - Newbie Ben
        • Jody
          Hi Ben, ... That is actually Claes Clip as stated in the Clip, but I do not get any errors here in Pro or Light. Perhaps it is the browser you are using. I
          Message 4 of 5 , Mar 2, 2001
          • 0 Attachment
            Hi Ben,

            >Some time ago I got a copy of Jody's Tab2Spaces clip. I don't
            >recall exactly where I got it, but it was from the internet
            >somewhere.

            That is actually Claes' Clip as stated in the Clip, but I do not
            get any errors here in Pro or Light. Perhaps it is the browser
            you are using. I just got it off of my Snatch-A-Clip to test
            using NetCaptor. http://www.notetab.net/html/snatchclp.htm

            ; Date: Mon, 15 May 2000 13:50:22 +0200
            ; Reply-To: ntb-clips@egroups.com
            ; Subject: Re: [Clip] Making a table
            ; Input data must have columns separated by either a tab
            ; character or two or more blanks. If you want to have a gap
            ; in the table, ie an empty cell followed by non-empty
            ; cell(s), you have to use tabs as column separators around
            ; that cell. Regards /Claes

            >It had numerous errors when I tried to run it. When I finally
            >got around to trouble shooting it I found that all of the errors
            >were caused by just one extra space at the end of perhaps half a
            >dozen lines. When these spaces (many were at the end of a label)
            >were removed the clip ran just fine.

            That would certainly mess it up. ;) I don't know how they got
            there unless it was your browser, perhaps my HTML, or maybe a
            real old version, ah, perhaps you got it at eGroups or
            YahooGroups. If that is the case, always use their View Source
            link if it is still there from eGroups, but:

            >Happy Tab'n - Newbie Ben

            How long you gonna stay a newbie Ben? <bg>

            Happy Clip'n!
            Jody

            http://www.notetab.net

            Subscribe, UnSubscribe, Options
            mailto:Ntb-Clips-Subscribe@yahoogroups.com
            mailto:Ntb-Clips-UnSubscribe@yahoogroups.com
            http://www.egroups.com/group/ntb-clips
          Your message has been successfully submitted and would be delivered to recipients shortly.