program to copy the contents to the file