On 18 Dec 2017, at 00:34, Rick Gordon <[email protected]> wrote:
> I'd also be interested to know what other approaches I might consider for 
> trimming a list of one email address per line, removing addresses from a list 
> of invalid or unsubscribed addresses.

that is a tough one, and I would not try to use grep for that. Instead, I would 
look at some ay to automate this. Maybe a text factory that went through each 
line in File A and removed a match in file B.

I mean, I would probably resort to a bash script for something like this if it 
was a one off, or perl (lord help me, not perl!) if it was something that 
needed to be done a lot and the speed of text-processing mattered (like 
thousands of items to process on a frequent interval).

The proper thing, of course, is to have a mailing list manager (like Mailman or 
Majordomo) that automatically processes bounces and unsubscribes instead of 
doing it manually. It might even be worth setting that up and then processing 
all the emails to remove via an admin email.

IIRC, Mailman will allow the admin of a list to submit many  (arbitrarily many) 
emails at once, either via an admin email or the web interface, but it has been 
many years since I stopped hosting mailing lists.

Of course, there are many other ways to skin this cat. A database, for example. 
Import your entire list and then use BBEdit to transform your unsubs into a SQL 
query to remove the matches then feed that into your SQL database and magically 
the matches get removed.

if you need to do this once, you can probably do it with sed via its -f flag, 
much like the SQL suggestion above, by creating a command file for sed that 
removes each email address for the main file, but that's not something I've 
done. I don't think it's complicated, but sed nearly always ends up taking more 
massaging than I expect.

It looks like a file unsub.txt with

/^[email protected]$/d
/^[email protected]$/d
…
/^[email protected]$/d

and

sed -f unsub.txt -i.bak fulllist.txt

would remove all the emails from the first file (assuming they are each on 
their own line) and would create fulllist.bak as an untouched backup.


-- 
Apple broke AppleScripting signatures in Mail.app, so no random signatures.

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to