Help!!

I need some help munipulating text files.

I have to write a program that does the following:

I have three text files ( X,Y,Z ). I want to write the data within these files to a new text file. This new text file has three headers. I want the data from X File under the first header, the data from Y file under the second and so on.

I also want to manipulate the format of the text files to comma seperated value before they get placed into my new text file.

I have not done that much coding with text files, so all help will be very much appreciated.

Regards

Mark