Characters - Newline - End of Line (EOL) - Line Separators - Line Break

1 - About

Text - Non-printing Character (Tabulation, New Line, ...)

To mark line endings in text files, the following characters are used:

  • Unix/Linux file systems use newlines (\n).
  • MacOS uses carriage-returns (\r).
  • Windows uses a carriage-return followed by a newline (\r\n).
Then a line can be considered to be terminated by any one of a line feed ('\n'), a carriage return ('\r'), or a carriage return followed immediately by a linefeed. Supporting all possible line terminators allows programs to read text files created on any of the widely used operating systems.

The line separator used by the in-memory representation of file contents is always the newline character. When a file is being loaded, the line separator used in the file on disk is stored in a per-buffer property, and all line-endings are converted to newline characters for the in-memory representation. When the buffer is consequently saved, the value of the property replaces newline characters when the buffer is saved to disk.

Also known as Line break sequences

This characters are control characters.

3 - Tools

3.1 - jEdit

You can found them in Jedit in Utilities > Buffer Options.

3.2 - Notepad++

3.3 - dos2unix

The dos2unix command line can transform the end of line: http://dos2unix.sourceforge.net/

4 - Encoding

Platform Line Ending Xml Unicode Oracle Database Java Description
Apple Macintosh [CR] (#x000D) chr(13) \r Carriage Return
UNIX Based Systems [LF] (#x000A) chr(10) \n line-feed
DOS Based Systems [CR][LF] (#x000D)(#x000A) \r\n carriage-return/line-feed
OS/390 [NEL] (#x0085) NEL

4.1 - Java


String lineFeed = "\n";
lineFeed.equals(String.valueOf((char) 10))

5 - Documentation / Reference


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap