@LINEENDS
— Reports the
line-end characters used in a text file.
Syntax:
%@LINEENDS[
filename,
n]
filename | the file to scan |
n | what to report: |
1 : the number of lines ending in CR/LF pairs | |
2 : the number of lines ending in LF/CR pairs | |
3 : the number of lines ending in CR not followed by LF | |
4 : the number of lines ending in LF not followed by CR | |
5 : the number of lines ending in NEL | |
10 : the total number of line-end sequences in the file |
If n is zero or not present, @LINEENDS
returns a string describing the file’s format:
Empty | The file contains no data. |
None | No line-end characters were found. |
CR/LF | The file uses CR/LF line ends. |
LF/CR | The file uses LF/CR line ends. (Who does this?) |
CR | The file uses CR line ends. |
LF | The file uses LF line ends. |
NEL | The file uses NEL line ends. |
Mixed | The file uses more than one line-end sequence. |
ERROR | There was an error reading from the file. |
See also: the @TEXTENCODING
and @TEXTFORMAT
functions.