Feb 10, 2014 at 7:07am UTC
I have a program that reads and writes data to binary a binary file. However when I open it up with a text editor I see one long line. However other binary files I run into have multiple lines, how can I split my data into lines?
What I have
^%%&^&*()*&$*&$(*& &%$(&$%)($^%*)($*^$ $(*^%$(*%$&%$(*%&$%$^%$^$#$%$%
What I want
^%%&^&*()*&$*&$(*& &%$(&$%)(
^%%&^&*$*^#$%()*&*& &%$(&$%)(*#(&^$#*(&$#
)_^)_&()$*%**(&(#$
Last edited on Feb 10, 2014 at 7:08am UTC
Feb 10, 2014 at 2:07pm UTC
It depends on what new line markers you have and what editor.
The standard windows notepad does not recognize the linux (\n) line endings.
Use e.g. notepad++ for this.
Feb 10, 2014 at 6:13pm UTC
Well viewing my binary file on Notepad++, or Vim (Linux) is the same long line.
Feb 10, 2014 at 6:27pm UTC
The newline characters are there, they just aren't read as newline characters by the program.
If you open the file as binary, and have your program display the text, you will see the newlines.