2

I created two files containing one line of identical text. One file was set to the LF newline, while the other was set to use a CRLF newline. The file using LF as the newline character was 1 byte smaller.

When writing large programs, is there an advantage to using either LF or CRLF apart from the apparent smaller file size?

  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Apr 14 '18 at 15:44

1 Answers1

0

It depends upon which programs will process the files written.

On Windows there are many programs which will only handle text files with CRLF line endings properly.

Programs on other operating systems like Linux or MaxOS will often only handle files with LF line endings properly.

A couple of programs will handle LF or CRLF equally well.

So if either CRLF or LF has advantages depends upon the specific situation.

Ralph Juhnke
  • 179
  • 2
  • 4