Add dat file output if file name ends with .dat