Applescript to compare two lists of domains and eliminate duplicates

applescript

I tried to do this with Automator and found it…lacking. I have tried to look for solutions everywhere else I can think of, but my searches keep pointing me to Applescript as the only available answer.

I need to automate this daily task that's very time consuming and have no idea how to do it in Applescript since I only started "learning" about it two days ago.

Hopefully someone here can help me out.

Here's what I want to do:

  1. I have a master list of domains.
  2. Compare the secondary list of domains I create everyday and have the duplicate entries removed (duplicates when compared to the master list).
  3. Then after I have had a chance to copy the left-over (non-duplicate) domains, have them be added to the master list for tomorrow.

It seems simple enough for this non-programming mind of mine, but I can't seem to find an easy way of doing this anywhere.

If you can think of an easy way that I'm not thinking of, please do let me know. Or if you have that gifted touch with Applescript, please tell me how to do this.

Thank you kindly in advance.

Thomas

Best Answer

It would be easier to use shell scripting:

grep -vxf master.txt today.txt > today2.txt; cat master.txt today2.txt > master2.txt