Questions tagged [line-endings]

Line-ending signifies end of line. Depending on operating system line-endings are different.

465 questions
350
votes
11 answers

How to find out line-endings in a text file?

I'm trying to use something in bash to show me the line endings in a file printed rather than interpreted. The file is a dump from SSIS/SQL Server being read in by a Linux machine for processing. Are there any switches within vi, less, more,…
Marco Ceppi
  • 5,877
  • 4
  • 27
  • 40
336
votes
5 answers

Why should I use core.autocrlf=true in Git?

I have a Git repository that is accessed from both Windows and OS X, and that I know already contains some files with CRLF line-endings. As far as I can tell, there are two ways to deal with this: Set core.autocrlf to false everywhere, Follow the…
Rich
  • 6,129
  • 4
  • 30
  • 51
275
votes
8 answers

Trying to fix line-endings with git filter-branch, but having no luck

I have been bitten by the Windows/Linux line-ending issue with git. It seems, via GitHub, MSysGit, and other sources, that the best solution is to have your local repos set to use linux-style line endings, but set core.autocrlf to true. …
Brian Donahue
  • 2,932
  • 3
  • 14
  • 11
263
votes
9 answers

What is the difference between \r and \n?

How are \r and \n different? I think it has something to do with Unix vs. Windows vs. Mac, but I'm not sure exactly how they're different, and which to search for/match in regexes.
Sam Lee
  • 8,493
  • 15
  • 44
  • 54
255
votes
12 answers

What does Visual Studio mean by normalize inconsistent line endings?

Visual Studio occasionally tells me: The line endings in the following files are not consistent. Do you want to normalize the line endings? It then gives me a drop down with different standards or something, such as Windows, Mac, Unix, and a…
CloudMeta
  • 39,869
  • 66
  • 178
  • 289
252
votes
8 answers

How to read lines of a file in Ruby

I was trying to use the following code to read lines from a file. But when reading a file, the contents are all in one line: line_num=0 File.open('xxx.txt').each do |line| print "#{line_num += 1} #{line}" end But this file prints each line…
draw
  • 4,259
  • 6
  • 27
  • 36
207
votes
13 answers

Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style

When using eslint in the gulp project i have encountered a problem with error like this Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style and I am using Windows environment for the running gulp and the entire error log is given below …
SaiKiran
  • 4,819
  • 10
  • 39
  • 66
184
votes
6 answers

Convert line-endings for whole directory tree (Git)

Following situation: I'm working on a Mac running OS X and recently joined a project whose members so far all use Windows. One of my first tasks was to set up the codebase in a Git repository, so I pulled the directory tree from FTP and tried to…
Lunikon
  • 3,301
  • 4
  • 21
  • 20
178
votes
4 answers

Fixing Sublime Text 2 line endings?

Here is my Settings - User config: { "auto_indent": true, "color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme", "default_line_ending": "LF", "detect_indentation": true, "font_size": 10.0, "ignored_packages": …
mintobit
  • 2,343
  • 2
  • 12
  • 15
174
votes
6 answers

With Git, how do I turn off the "LF will be replaced by CRLF" warning

With Git, when using the autocrlf = true flag, a warning is still given when line-endings are changed. I understand what the warning is for, and how to turn off the line-ending flag, but how do I turn off the warning itself?
sent-hil
  • 16,955
  • 15
  • 53
  • 71
162
votes
10 answers

Is it possible for git-merge to ignore line-ending differences?

Is it possible for git merge to ignore line-ending differences? Maybe I'm asking the wrong question ... but: I tried uisng config.crlf input but things got a bit messy and out of control, specially when I applied it after the fact. For one thing,…
hasen
  • 148,751
  • 62
  • 182
  • 223
144
votes
6 answers

Git status ignore line endings / identical files / windows & linux environment / dropbox / mled

How do I make git status ignore line ending differences? Background info: I use randomly Windows and Linux to work on the project. The project is in Dropbox. I found a lot about how do make git diff ignore line endings. Since i use meld git diff…
Thorsten Niehues
  • 11,698
  • 18
  • 69
  • 94
125
votes
15 answers

'Incomplete final line' warning when trying to read a .csv file into R

I'm trying to read a .csv file into R and upon using this formula: pheasant<-read.table(file.choose(),header=TRUE,sep=",") I get this warning message: "incomplete final line found by readTableHeader on 'C:\Documents and Settings..." There are a…
Kate
  • 1,261
  • 2
  • 10
  • 4
111
votes
10 answers

env: bash\r: No such file or directory

I'm trying to install YouCompleteMe from here. When I execute: ./install.sh --clang-completer I get this error: env: bash\r: No such file or directory I don't know what's wrong with environment variables. Here's my bash path: which bash…
Brijesh Rakholia
  • 1,215
  • 2
  • 9
  • 6
100
votes
16 answers

'^M' character at end of lines

When I run a particular SQL script in Unix environments, I'm am seeing a '^M' character at the end of each line of the SQL script as it is echoed to the command-line. I don't know on which OS the SQL script was originally created. What is causing…
Paul Reiners
  • 8,896
  • 30
  • 107
  • 178
1
2 3
30 31