On Wed, Mar 07, 2012 at 07:11:00PM -0800, Claude wrote: > I need to remove multiple email addresses from a large list. Is there > a way to compare two files and remove the addresses in one file from > the other file?
That's not necessarily something you would do with grep. You could do it with a script that reads in the first file, then processes the second file, only printing out the entries that weren't in the first file. However, there happens to be a handy Unix command-line utility that can do that easily in Terminal, if the files are lexically sorted: comm -23 all_emails remove_emails Given two sorted files, comm produces three columns: lines that are only in file 1, lines that are only in file 2, and lines that are in both files. -23 means suppress the second and third columns, leaving you just with the lines that are only in file 1. Ronald -- You received this message because you are subscribed to the "BBEdit Talk" discussion group on Google Groups. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at <http://groups.google.com/group/bbedit?hl=en> 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>
