| Welcome to WebmasterWorld Guest from 126.96.36.199 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|Sorting an email list with PHP?|
| 1:59 pm on Jun 19, 2013 (gmt 0)|
I have a ex-client email list of 10000+ email addresses. It looks something like this:
is there any way in PHP, Excel or anything - that will organise this list into separate files where only one occurrence of each company name is in each list? e.g.
I've been trying to do it manually, and my eyes are going fuzzy! It's taking forever.
| 2:44 pm on Jun 19, 2013 (gmt 0)|
I might explode them into a db with fullemail, person, domain and then you could do selects with group by or distinct
you could then store other info and have a little crm going
| 5:57 pm on Jun 19, 2013 (gmt 0)|
With the list saved as list.txt in the same folder, have a go with the following:
$lists = array();
$list = fopen("list.txt","r");
$email = trim(fgets($list));
$parts = explode("@",$email);
// find the first list without an address for example.com ($parts)
$i = 1;
// ...and add the address
$lists[$i][$parts] = $email;
//dump the lists
foreach($lists as $n => $emails)
print "List ".$n."\n\n";
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved