Adding a header and trailer to a file