Tuesday, 15 March 2011

php - How to extract an email address from multiple text files -


I have approximately 96 text emails for which I want to remove the sender's address. I believe that I can do this for domdoc I can use, but someone needs to start me Can someone please advise that there is a better way of doing this?

Thanks, Jim

There is no reason for PHP to do this. .. files are in some form of flat text, copy the file (s) (for example) email / directory, then

  cat * | Grep "From:" | Egrep -oi '\ b [A-Za-z0-9 ._% -] + @ [A-Za-z0-9 .-] + \. [A-Za-z] {2,4} '| Sort | Uniq & gt; Mail.list  

If you do this in PHP

  1. Copy file / mail to a directory < / Li>
  2. Get the list of files
  3. Read the file
  4. Split the header into a different string
  5. Two an email address on this string To find and put it on $ email_arr
  6. , array_unique () on $ email_arr.

No comments:

Post a Comment