Questions tagged [eol]

EOL is short for "end of line". In text files each line is terminated with characters such as linefeed or carriage return or a combination thereof.

EOL stands for "end of line" and refers to the various character or combination of characters that signify the end of each line of a text-based file.

For historical reasons there are various common EOLs:

  • linefeed or newline, ASCII 0x0A: common on systems with Unix heritage including Mac OS X
  • carriage return + linefeed, ASCII 0x0D 0x0A: common on systems with Microsoft DOS and Windows heritage and in text-based internet protocols
  • carriage return, ASCII 0x0D: used on Apple Macintosh up to System 7

These differences can present problems when using files and source code on multiple operating systems. Issues may be encountered with text editors, compilers, and revision controls systems.

See also

380 questions
5
votes
3 answers

os.EOL in Typescript+Node.js

How to use os.EOL in Typescript Node.js program? import { EOL } from 'os'; console.log("text"+EOL); // ??? This is not working. I downloaded os with npm i os -S but in node_modules/os/index.js file is only one line: module.exports =…
tBlabs
  • 2,619
  • 3
  • 18
  • 22
5
votes
1 answer

Problems configuring eol extension in Mercurial

I'm trying to clone a unix-hosted Mercurial repository to a Windows computer. I'm hoping to use the eol extension so that my text files with LF endings on the server have CRLF when cloned to a Windows computer. Previously I've used the win32text…
Nick Pierpoint
  • 17,641
  • 9
  • 46
  • 74
5
votes
1 answer

In R, how to read file with custom end of line (eol)

I have a text file to read in R (and store in a data.frame). The file is organized in several rows and columns. Both "sep" and "eol" are customized. Problem: the custom eol, i.e. "\t&nd" (without quotations), can't be set in read.table(...) (or…
Corrado
  • 625
  • 6
  • 12
5
votes
3 answers

CVS to Mercurial conversion: end of line problem

I recently converted a CVS repository to Mercurial. From the looks of it, everything went perfect. Except that every end-of-line character is in Unix style and I want them in Windows style. I know the hg convert command can be used to "convert" a…
Mizipzor
  • 51,151
  • 22
  • 97
  • 138
5
votes
2 answers

Match end of line (EOL) with syntax match in vim

When I hit / in vim and search for $ it highlights all eols. But when I try to match them with syntax match it does not seem to work. function! ConcealNonText() set conceallevel=1 set concealcursor=v syntax match NonText /$/ conceal…
Saucier
  • 4,200
  • 1
  • 25
  • 46
5
votes
1 answer

git cherry-pick and merge by ignoring EOL changes

Recently in all of our repos, we added a git attribute file to all our repos. The idea was to force use the Unix EoL chars in all files. This created huge issues first day when you checkout to a new branch, it starts to show changes in the entire…
openSource
  • 191
  • 2
  • 6
5
votes
1 answer

Converting Mercurial UNIX Line Endings to Windows

How do I clone a Mercurial repository so that the my working copy always has CRLF line endings? This is similar to this question Problems configuring eol extension in Mercurial But I'm missing something that it doesn't seem to work on my…
Rich Shealer
  • 3,362
  • 1
  • 34
  • 59
4
votes
1 answer

What is the difference between "* text=auto" and "* text=auto eol=lf"?

I was reading about the .gitattributes file and the rule to force line endings in some tutorials it's written like * text=auto and in some others, it's like * text=auto eol=lf at the first line of the file. Are there any differences? what does the…
Amir
  • 996
  • 7
  • 17
4
votes
1 answer

Visual studio code end of line setting (file with inconsistent line endings)

Is it possible to keep original end of lines in the file? (I use visual studio code to edit files on a linux server through SAMBA) There is a button at right bottom to choose either LF or CRLF, but it replace all the end of lines in the…
cho
  • 41
  • 2
4
votes
1 answer

Cross platform development using Git (EOL issue)

In our development environment we use Windows, Mac, and Linux. I am having trouble when it comes to the commit -> pull -> push work flow. The problem is end of line characters. If someone makes an edit on Mac and some one else makes an edit on…
Petah
  • 45,477
  • 28
  • 157
  • 213
4
votes
5 answers

SyntaxError: EOL while scanning string literal while using backslash escape

I know this is a noob question, but new to Python and trying to understand the following: Why does the backslash escape work without error here: >>> print "this is \\\ a string" this is \\ a string But when I try: >>> print "\\\" I get:…
AdjunctProfessorFalcon
  • 1,790
  • 6
  • 26
  • 62
4
votes
5 answers

making print_r use PHP_EOL

My PHP_EOL is "\r\n", however, when I do print_r on an array each new line has a "\n" - not a "\r\n" - placed after it. Any idea if it's possible to change this behavior?
neubert
  • 15,947
  • 24
  • 120
  • 212
4
votes
4 answers

determining the line terminator in Emacs

I'm writing a config file and I need to define if the process expects a windows format file or a unix format file. I've got a copy of the expected file - is there a way I can check if it uses \n or \r\n without exiting emacs?
gone
  • 4,342
  • 2
  • 24
  • 29
4
votes
1 answer

Fixing the line-endings in a Git repository using the `.gitattributes` file

What needs fixing: I have a repository containing a single .md file, which contains an essay I am writing. I edit the file from a few different computers, one running Linux and a couple running Windows. Looking at a git diff in Windows now where I…
guypursey
  • 3,114
  • 3
  • 24
  • 42
4
votes
2 answers

Why does vim sometimes show ^M and sometimes not (even if they are there)?

I'm trying to remove all CLRF characters from a projects git repo. I'm writing a command to grep through the repo recursively to find instances. However, some of the 'hits' when opened in vim show very explicitly that there is ^M and yet others do…
jshort
  • 1,006
  • 8
  • 23