output to flat file