sclipici Posted June 21, 2015 Report Posted June 21, 2015 <?php/* RST Visit www.rstforums.com Mail Sorter by sclipici Use: rst_sort('file_name.extension');*/function rst_sort($n){ $mails = file_get_contents($n); $mails = array_filter(explode("\n", $mails)); foreach ($mails as $key => $value) { $e = explode("@", $value); $a[][$e[1]] = $e[0]; } foreach ($a as $key => $value) { foreach ($value as $k => $v) { file_put_contents($k.'.txt', $v.'@'.$k. PHP_EOL, FILE_APPEND); } } echo 'Visit www.rstforums.com';} Quote
Ganav Posted June 21, 2015 Report Posted June 21, 2015 <?php/* RST Visit www.rstforums.com Mail Sorter by sclipici Use: rst_sort('file_name.extension');*/function rst_sort($n){ $mails = file_get_contents($n); $mails = array_filter(explode("\n", $mails)); foreach ($mails as $key => $value) { $e = explode("@", $value); $a[][$e[1]] = $e[0]; } foreach ($a as $key => $value) { foreach ($value as $k => $v) { file_put_contents($k.'.txt', $v.'@'.$k. PHP_EOL, FILE_APPEND); } } echo 'Visit www.rstforums.com';}Sau mai simplu:sort -u emails.txt Quote
sclipici Posted June 21, 2015 Author Report Posted June 21, 2015 App. Nu e chiar ca sort -u, iti creeaza un fiser pentru fiecare extensie de email-uri. Daca nu vreti sa-l folositi, nu mai postati aiurea. Quote
sleed Posted June 21, 2015 Report Posted June 21, 2015 Sau incearca ceva de genul:bad=["@gmail.com","@gov.com","@gov","@gov.de","@yahoo.com","mail.ru","yahoo.ca","yahoo","gmail.com","yahoo.com","googlemail.com","hotmail.com","hotmail.co.uk","hotmail.de","hotmail.co.uk","yahoo.ro","outlook.com","live.com","mail","yadex","aol","hotmail","live","outlook","gmail","msn","forbes"]l=open("listaEmailuri.txt","r").read().splitlines()for j in l: e=j.split("@") if "@" in j and e[1].lower().split(".")[0] not in bad: open("1.txt","a").write(j+"\n") else: open("0.txt","a").write(j+"\n") Unde python parser.py , si parseaza din listaEmailuri.txt Quote
black_death_c4t Posted July 3, 2015 Report Posted July 3, 2015 (edited) App. Nu e chiar ca sort -u, iti creeaza un fiser pentru fiecare extensie de email-uri. Daca nu vreti sa-l folositi, nu mai postati aiurea.de cand esti tu asa guru al linuxului? ai incercat sa dai sort -u pe un fisier ce contine mailuri si sa vezi ce se intampla?nu tre sa ai linux, e de ajuns un cygwin amarat Babun - a windows shell you will love!omul a oferit tuturor o alternativa rezonabila, nu mai plange ca o pizda ca nu esti ridicat in slavi pentru scriptul tau, nu poti forta lumea sa te aprecieze Edited July 3, 2015 by black_death_c4t Quote