How to check files and move the results to differents files?

Hi,

I am a newbie to shell scripting. here is my objective:
1)The shell program should take 2 parameters - ie-> DestinationFolder, WebFolder
2)Destination folder contains few files that has to has be verified and deleted.
3)WebFolder is a folder containing a list of master files
4)It should output 3 files - InWebFolder.txt, MalformedMailIDs.txt, NotInWebFolder.txt. THIS IS THE END RESULT
5)For each file in DestinationFolder

  1. Find if it contains a valid mail ID.
  2. If no,
    [list=1]
  3. see if there is an "@" in the file. If yes, write the full filename and path in the MalformedMailIDs.txt file
  4. If there is no "@" symbol, the file is simply to be discarded
    [/list]
  5. Check if that ID is found in WebFolder.
    [list=1]
  6. If not present, retain the file and put the filename in the NotInWebFolder.txt file
  7. If present, delete that file and put the full filename in the InWebFolder.txt file
    [/list]

How do i do this. can anyone plz guide me.
thanks in advance

what have you tried till now??