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

Re: [Clip] deleting records from one file contained in another

Expand Messages
  • Alec Burgess
    Everyone else was having so much fun I thought I d stick my oar in :-) (Sheryl - I didn t test yours but I really liked the approach!) Assuming that there are
    Message 1 of 6 , Jun 25, 2003
    • 0 Attachment
      Everyone else was having so much fun I thought I'd stick my oar in :-)
      (Sheryl - I didn't test yours but I really liked the approach!)

      Assuming that there are NO records in bad.txt that are not in good.txt then
      use these three one-liners: they could be combined into one clip but for an
      infrequently done task it showuld be ok the way it is:

      h="delbad1"
      ; run this clip on your bad.txt
      ; then take the resulting file and append it to good.txt as good_and_bad.txt
      ; "###" just has to be any string that doesn't occur on the end of any line
      ^!replace ".*" >> "&####" rwsa

      h="delbad2"
      ; sort good_and_bad.txt ascending before running this
      ; it will replace each pair of good+bad lines by one line containg the first
      ; 8 chars at the beginning (for verification ;-) suffixed by "=bad"
      ;
      ^!replace "{...........}{.*}\n{.*}###" >> "\1=bad" rwsa

      h="delbad3"
      ; this clip deletes all the "bad" lines
      ;
      ^!replace "\n.*=bad" >> "" rwsa

      Note: to handle records in bad.txt that are not in good.txt this (I think)
      should have worked - hopefully it will in Notetab 5

      h="delbad2-fails"
      ; find pairs of lines where 1st and 2nd are equal except
      ; for trailing "###" on 2nd line and delete both
      ; does not work with current regexp engine
      ;
      !^replace "{.*}\n\1###" >> "" rwsa

      Regards ... Alec
      --

      ---- Original Message ----
      From: "Information Services" <infoserv@...>
      To: <ntb-clips@yahoogroups.com>
      Sent: Wednesday, June 25, 2003 17:08
      Subject: Re: [Clip] deleting records from one file contained in another

      > Hugo and Larry,
      >
      > Thank you oh so much for creating those clips.
    • hugo_paulissen
      ... in :-) Alec, Nice approach, when I tested it I had some errors and an Access Violation (turned out that I still was working in an old version - 4.95
      Message 2 of 6 , Jun 26, 2003
      • 0 Attachment
        --- In ntb-clips@yahoogroups.com, "Alec Burgess" <burale@a...> wrote:
        > Everyone else was having so much fun I thought I'd stick my oar
        in :-)

        Alec,

        Nice approach, when I tested it I had some errors and an Access
        Violation (turned out that I still was working in an old version -
        4.95 doesn't give these messages...)

        One other thing worth mentioning is that it doesn't strip the first
        emailadres=bad (if it really appears on the first line).

        ^!replace "\n.*=bad" >> "" rwsa

        Regards,

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