output to file formatted