Computing.Net > Forums > Programming > CRLF and LF format

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

CRLF and LF format

Reply to Message Icon

Name: starp
Date: December 22, 2008 at 22:03:12 Pacific
OS: AMD
CPU/Ram: Core 2 dual
Product: Sf / SDFSDF
Comment:

Can some one tell me what these 2 formats CRLF and LF are and where they are used?
Thanks in advance!



Sponsored Link
Ads by Google

Response Number 1
Name: Valerie (by Garibaldi)
Date: December 22, 2008 at 23:31:27 Pacific
Reply:

I'm not sure what you are asking but CRLF generally means Carriage Return Line Feed (hex codes 0D and 0A)and are normally used at the end of a line.

CRLF moves the input/output to the leftmost position on the next line.


0

Response Number 2
Name: Judago
Date: December 22, 2008 at 23:36:07 Pacific
Reply:

[edit - beaten to the punch]

They both indicate where new lines start, the are used so text files aren't displayed as one long line.

I'm not sure why there are two formats, but CRLF is generally DOS\Windows and LF is generally Unix\Linux.

CR stands for "carriage return" and LF stands for "line feed". According to a post I read here by M2 the terminology comes from typewriters. Carriage return brings the barrel back to the beginning of the line and line feed goes down to the next line.

CR and LF are represented by the hex bytes 0D and 0A respectively.


It seems to me the Dos people may have said "we don't just want a new line, we want it at the beginning of the new line". The Unix people may have said "why waste a byte that does nothing?". Of course this is just pure speculation with absolutely no research, just a rationalisation of a trivial incompatibility.


0

Response Number 3
Name: wizard-fred
Date: December 23, 2008 at 01:35:48 Pacific
Reply:

To add further confusion. There is a third method carriage return only (CR) used in early Mac's. Remember these were originally based on hardcopy character devices (the typewriter).


0

Response Number 4
Name: klint
Date: December 23, 2008 at 05:21:14 Pacific
Reply:

There is a rumour that the Unix people decided to save a byte by shortening CR LF to a single character; they didn't choose CR because that's 13 decimal, which is unlucky.


0

Response Number 5
Name: Nigel Spike
Date: December 23, 2008 at 12:24:26 Pacific
Reply:

Some years back (during the DOS era) the users had to input many printer commands, into what may be described as printer drivers for word processing software, by themselves. Many of the dot matrix printers that were used couldn't print bidirectional, so the CR command was used without the LF, to send the printhead back to the beginning of the current line, for a second pass, to provide bold writing or NLQ (Near Letter Quality).

Nigel

This is just a sig


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon

Show hardware list using ... hide link in network driv...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: CRLF and LF format

The Web and Directory Formatting www.computing.net/answers/programming/the-web-and-directory-formatting/8219.html

Source code for format (filesystem) www.computing.net/answers/programming/source-code-for-format-filesystem/8243.html

comma (,) separating datas www.computing.net/answers/programming/comma-separating-datas-/12449.html