added utility for appending files with newline characters