In
computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, hardware and softw ...
, a line is a unit of organization for
text files. A line consists of a sequence of zero or more
characters, usually displayed within a single horizontal sequence.
The term comes directly from physical printing, where a line of text is a horizontal row of characters.
Depending on the
file system or
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
being used the number of characters on a line may either be predetermined or fixed, or the length may vary from line to line. Fixed-length lines are sometimes called
records. With variable-length lines, the end of each line is usually indicated by the presence of one or more special
end-of-line characters. These include
line feed
A newline (frequently called line ending, end of line (EOL), next line (NEL) or line break) is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character, or ...
,
carriage return
A carriage return, sometimes known as a cartridge return and often shortened to CR, or return, is a control character or mechanism used to reset a device's position to the beginning of a line of text. It is closely associated with the line feed ...
, or combinations thereof.
A blank line usually refers to a line containing zero characters (not counting any end-of-line characters); though it may also refer to any line that does not contain any visible characters (consisting only of
whitespace
White space or whitespace may refer to:
Technology
* Whitespace characters, characters in computing that represent horizontal or vertical space
* White spaces (radio), allocated but locally unused radio frequencies
* TV White Space Database, a m ...
).
Some tools that operate on text files (e.g.,
editors
Editing is the process of selecting and preparing written, visual, audible, or cinematic material used by a person or an entity to convey a message or information. The editing process can involve correction, condensation, organization, a ...
) provide a mechanism to reference lines by their
line number
In computing, a line number is a method used to specify a particular sequence of characters in a text file. The most common method of assigning numbers to lines is to assign every line a unique number, starting at 1 for the first line, and increm ...
.
See also
*
Newline
A newline (frequently called line ending, end of line (EOL), next line (NEL) or line break) is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character, or ...
*
Line wrap and word wrap
*
Line-oriented programming language, programming languages that interpret the end of line to be the end of an instruction or statement
Computer file formats
Computer data
References
{{reflist , refs=
[{{cite news , title=Windows Notepad finally understands everyone else's end of line characters , last=Duckett , first=Chris , date=2018-05-09 , publisher= ZDNet , url=https://www.zdnet.com/article/windows-notepad-finally-understands-everyone-elses-end-of-line-characters/ , access-date=2023-02-10 , url-status=live , archive-url=https://web.archive.org/web/20180513055845/https://www.zdnet.com/article/windows-notepad-finally-understands-everyone-elses-end-of-line-characters/ , archive-date=2018-05-13 ]