Extract e-mail addresses from large text file Is there any way I could search through a load of text documents and extract the email addresses from it into one new document?

I have this so far in Automator:

#!/bin/bash

Report=/Users/me/Desktop/mail/cur.txt

for f in /Users/me/Desktop/mail/test/*
do
    if [ -f "$f" ] ; then
        EMAIL=$(/usr/bin/grep -E -o '^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$' "$f" )
        if [ "$EMAIL" != "" ] ; then
            echo "$EMAIL" &gt;&gt; "$Report"
        fi
    fi
done


But I am getting lots of empty lines printed to the output.
#!/bin/bash

Report=/Users/me/Desktop/mail/cur.txt

for f in /Users/me/Desktop/mail/test/*; do
  if [ -f "$f" ] ; then
    EMAIL=$(/usr/bin/grep -E -o '([a-zA-Z0-9_\.-]+)@([a-zA-Z0-9_\.-]+)\.([a-zA-Z]{2,5})' "$f" )

    if [ "$EMAIL" != "" ] ; then
      echo "$EMAIL" &gt;&gt; "$Report"
    fi
  fi
done