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

Re: RE: [Clip] Deleting duplicate lines

Expand Messages
  • Adrian Worsfold
    Hello John Shotsky Using ^!Replace (?s)^([^ r n]+ R)(.* R+) 1 ARSW ^!IfError Next Else Skip_-1 Means Fred was a job man John was a job man Bill enjoyed
    Message 1 of 11 , Aug 31, 2013
    • 0 Attachment
      Hello John Shotsky

      Using

      ^!Replace "(?s)^([^\r\n]+\R)(.*\R+)\1" >> "" ARSW
      ^!IfError Next Else Skip_-1

      Means

      Fred was a job man
      John was a job man
      Bill enjoyed work
      Fred was a job man
      Fred had a job
      Fred was a job man
      Bill enjoyed work
      Bob was unemployed

      Becomes

      Bill enjoyed work
      Bob was unemployed

      Which is incorrect





      Adrian Worsfold

      http://www.pluralist.co.uk
      http://pluralistspeaks.blogspot.com
      pluralist@...
      31-08-2013
      ----- Received the following content -----
      From: John Shotsky
      Receiver: ntb-clips
      Time: 2013-08-31, 18:48:03
      Subject: RE: [Clip] Deleting duplicate lines


      [Non-text portions of this message have been removed]
    • John Shotsky
      Yes, of course it did. I sent it before I made the last change - Note the $2 in the replace side. ^!Replace (?s)^([^ r n]+ R)(.* R+) 1 $2 ARSW ^!IfError
      Message 2 of 11 , Aug 31, 2013
      • 0 Attachment
        Yes, of course it did. I sent it before I made the last change - Note the $2 in the replace side.
        ^!Replace "(?s)^([^\r\n]+\R)(.*\R+)\1" >> "$2" ARSW
        ^!IfError Next Else Skip_-1
        Regards,
        John
        RecipeTools Web Site: <http://recipetools.gotdns.com/> http://recipetools.gotdns.com/
        John's Mags Yahoo Group: <http://groups.yahoo.com/group/johnsmags/> http://groups.yahoo.com/group/johnsmags/

        From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Adrian Worsfold
        Sent: Saturday, August 31, 2013 11:51
        To: ntb-clips
        Subject: Re: RE: [Clip] Deleting duplicate lines


        Hello John Shotsky

        Using

        ^!Replace "(?s)^([^\r\n]+\R)(.*\R+)\1" >> "" ARSW
        ^!IfError Next Else Skip_-1

        Means

        Fred was a job man
        John was a job man
        Bill enjoyed work
        Fred was a job man
        Fred had a job
        Fred was a job man
        Bill enjoyed work
        Bob was unemployed

        Becomes

        Bill enjoyed work
        Bob was unemployed

        Which is incorrect





        Adrian Worsfold

        http://www.pluralist.co.uk
        http://pluralistspeaks.blogspot.com
        pluralist@... <mailto:pluralist%40pluralist.karoo.co.uk>
        31-08-2013
        ----- Received the following content -----
        From: John Shotsky
        Receiver: ntb-clips
        Time: 2013-08-31, 18:48:03
        Subject: RE: [Clip] Deleting duplicate lines

        [Non-text portions of this message have been removed]



        [Non-text portions of this message have been removed]
      • flo.gehrke
        ... I understand that this about unsorted lists, and the job is to remove duplicates without changing the order of lines. In this case, you better be cautious
        Message 3 of 11 , Sep 1, 2013
        • 0 Attachment
          --- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@...> wrote:
          >
          > Yes, of course it did. I sent it before I made the last change -
          > Note the $2 in the replace side.
          > ^!Replace "(?s)^([^\r\n]+\R)(.*\R+)\1" >> "$2" ARSW
          > ^!IfError Next Else Skip_-1
          > Regards,
          > John

          I understand that this about unsorted lists, and the job is to remove duplicates without changing the order of lines. In this case, you better be cautious with that clip. For example, a list like...

          BBB
          111
          111
          BBB
          222
          DDD
          222
          FFF

          is changed to...

          111
          111
          DDD
          FFF

          Certainly, this is not the expected result.

          Regards,
          Flo
        • John Shotsky
          Yep, you re right. It worked on my list, but yours included things I didn t test for. Now it works on your list too. ^!Replace (?s)^([^ r n]+ R) K(.+ R)* 1
          Message 4 of 11 , Sep 1, 2013
          • 0 Attachment
            Yep, you're right. It worked on my list, but yours included things I didn't test for.
            Now it works on your list too.
            ^!Replace "(?s)^([^\r\n]+\R)\K(.+\R)*\1" >> "$2" ARSW
            ^!IfError Next Else Skip_-1

            BBB
            111
            222
            DDD
            FFF

            Regards,
            John
            RecipeTools Web Site: <http://recipetools.gotdns.com/> http://recipetools.gotdns.com/
            John's Mags Yahoo Group: <http://groups.yahoo.com/group/johnsmags/> http://groups.yahoo.com/group/johnsmags/

            From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of flo.gehrke
            Sent: Sunday, September 01, 2013 09:23
            To: ntb-clips@yahoogroups.com
            Subject: Re: [Clip] Deleting duplicate lines


            --- In ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com> , "John Shotsky" <jshotsky@...> wrote:
            >
            > Yes, of course it did. I sent it before I made the last change -
            > Note the $2 in the replace side.
            > ^!Replace "(?s)^([^\r\n]+\R)(.*\R+)\1" >> "$2" ARSW
            > ^!IfError Next Else Skip_-1
            > Regards,
            > John

            I understand that this about unsorted lists, and the job is to remove duplicates without changing the order of lines. In this case,
            you better be cautious with that clip. For example, a list like...

            BBB
            111
            111
            BBB
            222
            DDD
            222
            FFF

            is changed to...

            111
            111
            DDD
            FFF

            Certainly, this is not the expected result.

            Regards,
            Flo



            [Non-text portions of this message have been removed]
          • Adrian Worsfold
            Hello ^!Replace (?s)^([^ r n]+ R) K(.+ R)* 1 $2 ARSW ^!IfError Next Else Skip_-1 Needs a return on the final line end otherwise it doesn t remove a
            Message 5 of 11 , Sep 1, 2013
            • 0 Attachment
              Hello

              ^!Replace "(?s)^([^\r\n]+\R)\K(.+\R)*\1" >> "$2" ARSW
              ^!IfError Next Else Skip_-1

              Needs a return on the final line end otherwise it doesn't remove a duplicate line at the end.

              David took a service
              Paul didn't take a service
              Geoff didn't take a service
              Janet didn't take a service
              Janet didn't take a service
              David took a service





              Adrian Worsfold

              http://www.pluralist.co.uk
              http://pluralistspeaks.blogspot.com
              pluralist@...
              01-09-2013
              ----- Received the following content -----
              From: John Shotsky
              Receiver: ntb-clips
              Time: 2013-09-01, 18:08:30
              Subject: RE: [Clip] Deleting duplicate lines


              [Non-text portions of this message have been removed]
            Your message has been successfully submitted and would be delivered to recipients shortly.