defined a formatter for csv and json file