Add record type and checksum to data lines.
Write hex output to file with .hex extension.
Remove carriage return from the end of each data line and retain newline only, to prevent blank lines in output.