|We don't bite newbies here... much|
Re: comparing and deleting some words from fileby Roger (Parson)
|on Nov 09, 2005 at 07:42 UTC||Need Help??|
Let me describe a quick way of doing this...
0. assumption - you will never modify file 1, because you will only delete from file 2;
1. read the first file into a hash table, having each word as the hash key;
2. create a third file;
3. while scanning the second file, check the hash table built in step 1 for existance of the word;
if the word exists, do not print to the third file;
if the word does not exist, print the the third file;
4. replace file 2 with the third file.