Wouldn't it be simpler and flexible to do it in Cobol or any other language program of your comfort ? Why go fancy? Someone else later working on it will find it easy and maintainable if we keep it easy at first place.
Well, regardless of the programming language you might want to think about how you are going to handle if the 'comma separated CC email ids' is too long to be accommodated in one record. Can you show such an example with the expected output?