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

Re: [Clip] Removing numbers from a list

Expand Messages
  • abairheart
    Franz, let me add my two cents worth to the finding of numbers with regexp in NoteTab: I have found, that NoteTab does not recognize escaped characters as well
    Message 1 of 12 , Dec 1, 2004
    • 0 Attachment
      Franz,

      let me add my two cents worth to the finding of numbers with regexp
      in NoteTab:

      I have found, that NoteTab does not recognize escaped characters as
      well as character classes. Whenever I search for digits, I use 0-9.

      In your case:

      ^!Replace "^[0-9]+$"(tab)""(tab)RIS

      Placing quotes around the search string ALSO confuses NoteTab at
      times. So the search command above will also work without the quotes!
      In other words, two consecutive tabs will replace the search string
      with nothing

      Abair
    • Alec Burgess
      ... FWIW, I ve found the most unambiguous notation for replace strings in regexp clip lines is: ^!replace find-string-quoted replace-string-quoted R
      Message 2 of 12 , Dec 1, 2004
      • 0 Attachment
        > Placing quotes around the search string ALSO confuses
        > NoteTab at times.

        FWIW, I've found the most unambiguous notation for replace strings in regexp
        clip lines is:

        ^!replace "find-string-quoted" >> "replace-string-quoted" R
        and-other-options

        Regards ... Alec
        --


        ---- Original Message ----
        From: "abairheart" <abairheart@...>
        To: <ntb-clips@yahoogroups.com>
        Sent: Wednesday, December 01, 2004 15:33
        Subject: [gla: Re: [Clip] Removing numbers from a list

        > Franz,
        >
        > let me add my two cents worth to the finding of numbers
        > with regexp
        > in NoteTab:
        >
        > I have found, that NoteTab does not recognize escaped
        > characters as well as character classes. Whenever I
        > search for digits, I use 0-9.
        >
        > In your case:
        >
        > ^!Replace "^[0-9]+$"(tab)""(tab)RIS
        >
        > Placing quotes around the search string ALSO confuses
        > NoteTab at times. So the search command above will also
        > work without the quotes! In other words, two consecutive
        > tabs will replace the search string with nothing
      • franz_sternbald
        Hi all, @ Josh ... I have to confirm that bug. NoteTab is doing exactly what you wrote. @Abair ... Maybe. In a clip, however, I don t see any difference
        Message 3 of 12 , Dec 3, 2004
        • 0 Attachment
          Hi all,

          @ Josh

          > NTB Search and replace seem to have a bug, after
          > a replace it picks up on the line after the one
          > it left on if your search ends with a CR.
          > If you advance the search manualy it does it correctly,
          > but if you 'replace all' it misses lines directly
          > following a previous hit.

          I have to confirm that bug. NoteTab is doing exactly what you wrote.

          @Abair

          > I have found, that NoteTab does not recognize escaped
          > characters as well as character classes. Whenever I search
          > for digits, I use 0-9.

          Maybe. In a clip, however, I don't see any difference between ^\d+$
          and ^[0-9]+$. I get into trouble when trying to remove the empty line
          that's left when a number has been deleted. That is,...

          ^!Replace "^[0-9]+" >> ""

          works fine, but...

          ^!Replace "^[0-9]+\n" >> ""

          will leave behind a lot of undeleted numbers. As Alan said, we are
          better off when checking it against IsNumeric. Having tested all your
          recommendations, I come to the following synthesis. A clip that
          reliably deletes all numbers from list could be...

          ^!Jump 1

          :Loop
          ^!IfTrue ^$IsNumber(^$GetLine$)$ Next Else ^!Jump +1
          ^!Replace "^[0-9]+$\n" >> "" RS
          ^!IfError End
          ^!GoTo Loop

          :End

          I tested it with a list of 10,000 lines. All numbers (integers) were
          completely removed.

          Regards,
          Franz
        • abairheart
          ... in regexp ... Hehehe, so which is i, to find the string-quoted at the start of a line? ^!Find ^ string-quoted ^!Find ^string-quoted ? Varies depeding on
          Message 4 of 12 , Dec 3, 2004
          • 0 Attachment
            --- In ntb-clips@yahoogroups.com, "Alec Burgess" <burale@a...> wrote:
            > > Placing quotes around the search string ALSO confuses
            > > NoteTab at times.
            >
            > FWIW, I've found the most unambiguous notation for replace strings
            in regexp
            > clip lines is:
            >
            > ^!replace "find-string-quoted" >> "replace-string-quoted" R
            > and-other-options
            >
            > Regards ... Alec

            Hehehe,

            so which is i, to find the string-quoted at the start of a line?

            ^!Find ^"string-quoted"
            ^!Find "^string-quoted" ?


            Varies depeding on what else is in the string.


            Abair
          • Jody
            Hi Abair & Alec, ... Could one of you kindly tell me what in the world you are talking about starting right after the for what it s worth? You have me
            Message 5 of 12 , Dec 3, 2004
            • 0 Attachment
              Hi Abair & Alec,

              >--- In ntb-clips@yahoogroups.com, "Alec Burgess" <burale@a...> wrote:
              >> > Placing quotes around the search string ALSO confuses
              >> > NoteTab at times.
              >>
              >> FWIW, I've found the most unambiguous notation for replace
              >> strings in regexp clip lines is:
              >>
              >> ^!replace "find-string-quoted" >> "replace-string-quoted" R
              >> and-other-options
              >>
              >> Regards ... Alec
              >
              >Hehehe,
              >
              >so which is i, to find the string-quoted at the start of a line?
              >
              >^!Find ^"string-quoted"
              >^!Find "^string-quoted" ?
              >
              >Varies depeding on what else is in the string.

              Could one of you kindly tell me what in the world you are talking
              about starting right after the for what it's worth? You have me
              completely lost. Thanks!

              See ya in the funnies,
              Jody Adair, Prov. 15:15

              Blessed are they who can laugh at themselves
              for they shall never cease to be amused.
              http://www.clean-funnies.com
            • Alan C.
              On Fri, 03 Dec 2004 22:47:20 -0000, abairheart wrote: [ . . ] ... Supposed to be (I think) all inside the quotes with nothing to the left of the left hand
              Message 6 of 12 , Dec 3, 2004
              • 0 Attachment
                On Fri, 03 Dec 2004 22:47:20 -0000, abairheart wrote:
                [ . . ]
                > so which is i, to find the string-quoted at the start of a line?
                >
                > ^!Find ^"string-quoted"
                > ^!Find "^string-quoted" ?

                Supposed to be (I think) all inside the quotes with nothing to the left of the left hand quote.

                Have you also tested/tried:

                ^!Find "^(string-quoted)"

                ()

                grouping. above, just 1 group. next, 3 potential to find (each of the 3 is a group)

                ^!Find "^(string-quoted1)|(string-quoted2)|(string-quoted3)"

                --
                Alan.
              Your message has been successfully submitted and would be delivered to recipients shortly.