Remove bad records from file and move them into a file then send those via email

view story

http://www.unix.com – Hi my requirement is that i want pull the bad records from input file and move those records in to a seperate file. that file has to be sent via email.. any suggentions please (HowTos)