save the output to a file