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

Re: How to remove lines with the word ^

Expand Messages
  • diodeom
    ... Either: ^!Set %word%=yahoo ^!Replace ^.*? Q^%word% E.*( R| Z) WARS or: ^!Set %word%=yahoo ^!Find ^%word% WITS ^!IfError End ^!DeleteLine ^!Goto
    Message 1 of 9 , Nov 3, 2011
    • 0 Attachment
      "C" <backup2abet@...> wrote:
      >
      >
      > In other words, I need to use a variable in place of the (....), because will be a lot of different words.
      >

      Either:

      ^!Set %word%=yahoo
      ^!Replace "^.*?\Q^%word%\E.*(\R|\Z)" >> "" WARS

      or:

      ^!Set %word%=yahoo
      ^!Find ^%word% WITS
      ^!IfError End
      ^!DeleteLine
      ^!Goto Skip_-3
    • Don
      right, set the variable thus word1|word2|word3 Your text for the word is funky so I m guessing maybe you have special characters in there that need to be
      Message 2 of 9 , Nov 3, 2011
      • 0 Attachment
        right, set the variable thus word1|word2|word3

        Your text for the word is funky so I'm guessing maybe you have special
        characters in there that need to be pre-pended with and escape? \" or \)

        And then:
        ^!Replace "^.*(^%variable%).*\R" >> "" RAWS

        As usual I have no idea what dio is talking about -- but I'm sure it
        totally works.

        On 11/3/2011 3:46 PM, C wrote:
        >
        > In other words, I need to use a variable in place of the (....), because will be a lot of different words.
        >
        > ------------------------------------
        >
        >
        > --- In ntb-clips@yahoogroups.com, "C" <backup2abet@...> wrote:
        >>
        >> Hi,
        >>
        >> Perhaps is because I used:
        >>
        >> ^!Set rdSDyahoo
        >> ^!Replace "\R.*(^rdŽ*\R" >> "\n" WRASTI
        >>
      • Axel Berger
        ... I can t read that. Going to the source I find ^!Set =18rdSDyahoo ^!Replace R.*(^=18rd=8E* R n WRASTI What are the characters $18 and $8E? You ll
        Message 3 of 9 , Nov 3, 2011
        • 0 Attachment
          C wrote:
          > ^!Set rdSDyahoo
          > ^!Replace "\R.*(^rdŽ*\R" >> "\n" WRASTI

          I can't read that. Going to the source I find

          ^!Set =18rdSDyahoo
          ^!Replace "\R.*(^=18rd=8E*\R" >> "\n" WRASTI

          What are the characters $18 and $8E? You'll probably nned to write them
          as \x18 and \x8E whatever they are for. I have just tried using
          variables inside a Regex Replace myself and to my surprise it worked
          fine.

          Axel
        • Don
          I use variables in regex s all the time myself. I think using ^ (means beginning of the line) instead of R is better at the front because it could be the
          Message 4 of 9 , Nov 3, 2011
          • 0 Attachment
            I use variables in regex's all the time myself.

            I think using ^ (means beginning of the line) instead of \R is better at
            the front because it could be the first line.

            Dio used (\R|\Z) at the back end which is better than either of us as it
            will include the last line. I am trying to remember that one more myself.

            I don't get his \Q and \whatever it was in the middle so I need to go
            look those up ... maybe word boundary or something?

            On 11/3/2011 6:38 PM, Axel Berger wrote:
            > C wrote:
            >> ^!Set rdSDyahoo
            >> ^!Replace "\R.*(^rdŽ*\R" >> "\n" WRASTI
            >
            > I can't read that. Going to the source I find
            >
            > ^!Set =18rdSDyahoo
            > ^!Replace "\R.*(^=18rd=8E*\R" >> "\n" WRASTI
            >
            > What are the characters $18 and $8E? You'll probably nned to write them
            > as \x18 and \x8E whatever they are for. I have just tried using
            > variables inside a Regex Replace myself and to my surprise it worked
            > fine.
            >
            > Axel
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.