output file as csv and json