/* Find e-mails in text file, calculate qty for every e-mail, show duplicates */ /* eCo Software, 2009/05 */ /* Clean the file: * remove tabs (character 9) */ /* filename with e-mails, the file may contain comments and names */ fmain="All-emails" qty=0 do while lines(fmain)>0 s=linein(fmain) nwords=words(s) /*say "words: " nwords*/ do i = 1 to nwords iword=word(s, i) if pos("@", iword)>0 then do /* say iword */ /* e-mail found! */ found=0 do j = 1 to qty if pos(iword, database.j.email)>0 then do found=1 database.j.quantity=database.j.quantity+1 end end /* not found => add */ /* не найдено => добавить */ if found=0 then do qty=qty+1 database.qty.email=iword database.qty.quantity=1 end end end end say "" say "Duplicates:" do j = 1 to qty if database.j.quantity>1 then say database.j.quantity database.j.email end