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

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

Expand Messages
  • Information Services
    Hugo and Larry, Thank you oh so much for creating those clips. I changed the file names and tested Larry s version and it seems to have worked like a charm.
    Message 1 of 6 , Jun 25, 2003
    • 0 Attachment
      Hugo and Larry,

      Thank you oh so much for creating those clips.

      I changed the file names and tested Larry's version and it seems to have worked like
      a charm.

      Saved me from manually searching and finding 1398 entries to delete.


      If I can do anything for either of you guys ( I run a newsletter) let me know.


      Regards,

      Keith



      On 25 Jun 2003 at 14:57, Larry Thomas wrote:

      >
      > Hi Keith
      >
      > At 10:14 AM 6/25/03 -0500, you wrote:
      > >Hi,
      > >
      > >I know nothing about writing clips. Can someone help me?
      > >
      > >I have a subscriber list of email addresses. I have also created a list of
      > bad or invalid
      > >email addresses that I want to remove from my subscriber list.
      > >
      > >How do I go about doing this?
      >
      > You must have just missed Hugo Paulissen's clip which he posted to this list.
      >
      > Here it is again:
      >
      > Clip
      > -------
      > ^!Open "C:\Program Files\NoteTab Pro\Goodlist.txt"
      > ^!Open "C:\Program Files\NoteTab Pro\Badlist.txt"
      > ^!Jump 1
      > ^!Set %StopAT%=1
      > :REMOVE
      > ^!If ^%StopAT%>^$GetLineCount$ END
      > ^!Select EOL
      > ^!Set %baditem%=^$getSelection$
      > ^!Open Goodlist.txt
      > ^!Replace "^%baditem%" >> "" AIWS
      > ^!Open Badlist.txt
      > ^!Jump +1
      > ^!INC %StopAT%
      > ^!GoTo REMOVE
      > -----------
      >
      > I have tested this clip on two lists that Hugo suggested and it worked but
      > it leaves a blank line for each one that it removes.
      >
      > The two lists are:
      >
      > Goodlist.txt
      > ------------
      > 123456#123456.120
      > 123456#123456.121
      > 123456#123456.130
      > 123456#123456.131
      > 123456#123456.140
      > 123456#123456.141
      > 123456#123456.150
      > 123456#123456.151
      > 123456#123456.160
      > 123456#123456.161
      > 123456#123456.170
      > 123456#123456.171
      > 123456#123456.180
      > 123456#123456.181
      > 123456#123456.190
      > 123456#123456.191
      > 123456#123456.200
      > 123456#123456.201
      > 123456#123456.210
      > 123456#123456.211
      > 123456#123456.220
      >
      > Badlist.txt
      > -----------
      > 123456#123456.120
      > 123456#123456.200
      > 123456#123456.211
      >
      > Below is my version of this clip which removes all of the blank lines.
      >
      > H="RemoveBadList"
      > ;Hugo Paulissen
      > ;Modified by:
      > ;Larry Thomas <larryt@...>
      > ;06/25/2003, 02:44:30 PM
      > ;Hugo's clip left a blank line for each one removed.
      > ;This clip removes the blank lines.
      > ^!Open "C:\Program Files\NoteTab Pro\Goodlist.txt"
      > ^!Open "C:\Program Files\NoteTab Pro\Badlist.txt"
      > ^!Jump 1
      > ^!Set %StopAT%=1
      > :REMOVE
      > ^!If ^%StopAT%=^$GetLineCount$ END
      > ^!Select EOL
      > ^!Set %baditem%=^$getSelection$
      > ^!Open Goodlist.txt
      > ;^!SetDebug On
      > ^!Find "^%baditem%" AIWS
      > ^!Deleteline
      > ;^!Goto Exit
      > ^!Open Badlist.txt
      > ^!Jump +1
      > ^!INC %StopAT%
      > ^!GoTo REMOVE
      >
      > Regards,
      >
      > Larry
      > larryt@...
      >
      > Joseph Stalin's grave is a Communist Plot!
      >
      >
      >
      >
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      >



      Keith Londrie II
      Information Specialist
      Refund Specialist Subscribe to The Info-ReSource
      2466 340th St. Suite #16 FREE Weekly Newsletter
      Keokuk, Iowa 52632 mailto:subscribe@...
      infoserv@...
      1-319-524-1763 International http://latepackagerefunds.com
      1-800-804-5832 Toll Free http://info-resource.com
      1-319-526-5934 Fax
    • 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 2 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 3 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.