try fprintf for text file newline