create object for writing the data in a file