gossamer has asked for the wisdom of the Perl Monks concerning the following question:
Hi all,
I'm relatively new to perl and having some trouble with what I'd imagine is a classic issue for perl. I'd like to remove a list of email addresses in one file that appear in another.
In other words, given file removelist.txt, which contains:
user1@example.comIn some cases the lines may appear like this:
user1@example.com<mailto:user1@example.com>
due to bad HTML email clients. I'd like to remove all occurrences of each of the lines of the file from the file masterlist.txt, ignoring case.
I've played around with it a bit, but having trouble removing all at once, instead of iterating through the file and creating a temporary file for each email address in the removelist file.
I've also tried a combination of sed with egrep, but haven't figured out how to add a pipe character for the 'or' at the end of each line of the removelist.txt file except the last line.
Thanks for any ideas.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Removing users from a list
by BrowserUk (Patriarch) on Sep 09, 2012 at 01:19 UTC | |
|
Re: Removing users from a list
by Kenosis (Priest) on Sep 09, 2012 at 05:18 UTC | |
by CountZero (Bishop) on Sep 09, 2012 at 07:39 UTC | |
by Kenosis (Priest) on Sep 10, 2012 at 02:04 UTC | |
|
Re: Removing users from a list
by 2teez (Vicar) on Sep 09, 2012 at 00:41 UTC | |
|
Re: Removing users from a list
by pvaldes (Chaplain) on Sep 09, 2012 at 00:55 UTC | |
|
Re: Removing users from a list
by BillKSmith (Monsignor) on Sep 09, 2012 at 16:04 UTC | |
by gossamer (Sexton) on Sep 10, 2012 at 01:34 UTC |