devWhiz Posted August 5, 2011 Share Posted August 5, 2011 I have a huge list of emails in a text file in this format spankthatdoot@live.com, d00talicious@aol.com, peekaboom2009@live.com, d00tzpetbyrd@aol.com, mamalucious2007@yahoo.com, d00tch3rrybo0@yahoo.com, d00tw00t3r@gmail.com, bogeystar@earthlink.net, only4mobsters2@hotmail.com, elbobman@yahoo.com, elbobman@hotmail.com, cranoke24@yahoo.com, kara_johansen@hotmail.com, randyfarmer_33@yahoo.com, reawakining666@yahoo.com, carlosm2k@yahoo.com, cannette21@aol.com, jes2tngo@yahoo.com, lanenaema@yahoo.com, blainedead@bellsouth.net, buckchaser101@aol.com, lunar.sea@hotmail.com, xr_ghost@hotmail.com, rebeljuice1@hotmail.com, lilpoca313@yahoo.com, cricket0273@yahoo.com, gidget21973@yahoo.com, sweety161@t-online.de, wantab_jerry@yahoo.com, meredith_emerald@yahoo.com, israel@jokersjewels.com, bethosu94@yahoo.com, mustheartpandas@gmail.com, huan_nguy3n@yahoo.com, djtallen03@yahoo.com, jxl95@aol.com, wildman08083@live.com, mileshh82@yahoo.com, nicktheiscar@yahoo.com, dukies32@yahoo.com, rolys12@yahoo.com, lx2408@aol.com, jaymz_disposition@yahoo.com, dderoch@yahoo.com, no.one@domain.adr, I need a script to read the list and make a new list only including the yahoo, ymail or rocketmail email address in the format like this email@yahoo.com email@rocketmail.com email@ymail.com email@yahoo.com email@yahoo.com so it would just need to remove all of the emails from the list that are not yahoo, rocketmail or ymail as well as the commas and put them in another text in the above format, if anyone is able to help me out with this is would be appreciated! thanks! Quote Link to comment Share on other sites More sharing options...
devWhiz Posted August 5, 2011 Author Share Posted August 5, 2011 so say I have this list in the file diplomarc4@gmail.com, texmex1073@yahoo.com, mexamer73@yahoo.com, virtuus73@yahoo.com, kingpuncher1@yahoo.com, bigcitykillaS@aol.com, impeaches33@gmail.com after running the script, the output file should look like this texmex1073@yahoo.com mexamer73@yahoo.com virtuus73@yahoo.com kingpuncher1@yahoo.com script would remove diplomarc4@gmail.com, bigcitykillaS@aol.com, impeaches33@gmail.com is this possible? Quote Link to comment Share on other sites More sharing options...
WebStyles Posted August 5, 2011 Share Posted August 5, 2011 use file_get_contents to load the file. explode to seperate the emails into an array, and a foreach loop to remove the ones you don't want. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.