Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple List Mangement
#1
If you have a mac or linux based system you can perform some simple list management right from the command line.
If you have windows you can still use these tools but you will need to download Cygwin.
Download Cygwin here: https://www.cygwin.com

The tools for this job are comm, sort, uniq and cut.
Typically I get a file that is comma delimited and I start by extracting the email addresses.

Here is the command.
  cut -d "," -f 1
This command says that we have a comma delimited file and we want to output the first column.

We will use the unix pipe mechanism to sort and remove duplicates with one line like so.
  cut -d "," -f 1 | sort | uniq > new_file.txt

You now have all your emails in a file sorted and with duplicates removed.

Now you need to get your suppression file prepared. To prepare the suppression file you use sort and uniq redirecting the output to a file for later use.
  sort suppression.txt| uniq > suppression_out.txt

Now that the 2 files are ready you can suppress the emails in the suppression file using the comm utility.
  comm -23 new_file.txt suppression_out.txt > new_list.txt

Now you have a list with the suppression_out.txt emails removed. 

I've used this a lot over the years. Hope it helps. 

Ask questions if you need more information.

Links to command man pages.

comm
sort
uniq
cut
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)