Check for proper e mail id format

Hi,
We run an application called meta which reads user information from database and updates in LDAP.For that we have some scripts to check the uniqueness of mail ids between the existing LDAP and Database.It works fine when people enter mail ids in proper format (xxx.yyy@abc.com) but if it entered in wrong format (x 99 yy abc@com) the uniqueness check fails. We extract the mail ids in a text file before adding. Can you suggest any script which will remove the wrong entry. We use solaris 9 as OS.
Thanks in advance

try this:

for emailid in $(cat filename) ; do
echo $emailid | awk -FS="@" '{
if ( $1 == "" || $2 == "" || $2 !~ /\./ )
print "Invalid Id"
else
print "Valid Email Id"

}

:smiley: Thanks for the idea.Can you just provide me one more idea? If i want to read 1st column of some EXEL format file having two columns how do I do that?