bradgrafelman;10977041 wrote:Can you explain a little more about how this "suppression file" is used? What does it look like?
EDIT: Also, if you've got a working C implementation, feel free to post that for clarification as well.
Hey, thanks for replying. okay so the suppression file just has a list of strings in it, in this case phone numbers. the idea is to iterate through the given file and find out if that number is in the "suppression file", if it is, then flag it.
here is part of the C code I wrote. As you can see when given two files I just allocated the files to some structs and then worked on the structs for removing the duplicates I wanted. Once done, i just wrote the records i wanted back to the file.
/*start from the first record in the lead file ....*/
for(record_ndx=0;record_ndx<recs;record_ndx++){
/*for each record print it...*/
fprintf(outfile,"%s,",lead_file[record_ndx].phone_digit);
fprintf(stdout,"Checking record: %ld\r",record_ndx+1);
/*...and compare against each num in suppression list...*/
for(dup_count=0;dup_count<sups;dup_count++){
/*...for each number if it compares and is equal......*/
if( (strcmp(lead_file[record_ndx].phone_digit,sup_file[dup_count].phone_digit))==0)
times++;
}//end of for loop
/*next record...but before that print out how many times it appeared in file*/
fprintf(outfile,"Duplicated %ld times\n",times);
dupes_in_file+=times;
times=0;/*reset the occurance of that particular duplicate*/
}/*end of all records being checked in for loop*/
I know I'm just "thinking in C" and i'm sure there is a easier way to do this in php. 😉