line-endings

How to replace line-endings in VIM

How can I replace all line-endings in big file (>100MB)? I have tried to do :%s/\n/, /g but it's too slow. ...

^M characters when using Tramp (on Windows) to connect to Ubuntu Server

I've set up Tramp on Emacs on my Windows 7 box (64 bit). For this test, this is the only thing in my emacs-config: (setq tramp-default-method "plink") Then I connect to my Ubuntu Server 9.10 running in a VM on my local network. Connection goes fine, i can use dired to browse folders and open files. Yay! However, git status shows up a...

editing a file with vim that has no EOL marker on the last line but has CRLF line endings

I often have to edit script files, the interpreter for which treats files that have an EOL marker on the last line of the file as an error (i.e. the file is treating CRLF as "newlines", not as "line endings"). Currently, I open these files in Vim using binary mode (-b on the command line). It autodetects the lack of EOL on the final li...

How can I detect dos line breaks in a file?

I have a bunch of files. Some are unix line endings, many are dos. I'd like to test each file to see if if is dos formatted, before I switch the line endings. How would I do this? Is there a flag I can test for? Something similar? ...

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 instructions here (echoed on GitHub's help pages) to convert the repository to contain onl...

Stranges files in my assembly since switching to <lineEnding>unix</lineEnding>

Hi, since I've inserted the option <lineEnding>unix</lineEnding> into my fileSets and files in my Maven assembly plugin configuration, strange files are placed in my tar. They look as following: ignore.me.1499711160.filtered.903528596.formatted run.sh.2124782621.filtered.1130667884.formatted Do you know why this occurrs? ...

git crlf configuration in mixed environment

I'm running a mixed environment, and keep a central, bare repository where I pull and push most of my stuff. This centralized repository runs on Linux, and I check out to Windows XP/7, Mac and Linux. In all repositories I put the following line in my .git/config: [core] autocrlf = true I don't have the flag safecrlf=true anywhere...

How do I repair all corrupt lines ending from files on a subversion repository

I have a big subversion repository and I discovered that many .py files (and maybe others) do not have the proper line endings, generating problems when checked out on different platforms. How can I solve this without repairing them one by one? Also how to I prevent others from corrupting the repository? ...

Transferring a site - various file issues

I am putting an old website up on a new server and i've noticed various issues. Firstly, if i look at any of the files locally they all have double line spacing - anywhere there is a newline there has also been a blank line inserted. This is the same in netbeans and notepad++. Then, when i SFTP the files to the server and view them in Vi...

Normalizing line endings in Visual Studio 2010

We have multiple developers working on an application and it seems that whenever one particular person works on a file then anyone else works on it they will get: The line endings in the following file are not consistent. Do you want to normalize the line endings? Is there some option in Visual Studio that we can have that developer c...

How do you compare two text files with different line endings in PHP?

I need to compare two text files in php. One file is user uploaded, and the other is supplied by the server, running on windows. This works fine when the file is submitted from another windows computer, but from a linux computer the files come out different, I am assuming this is because of different line endings. Is there an easy way t...

I need to know what line endings setting to use for Textmate and SVN

I am using Textmate (bran new user) as my editor of choice. Today I did svn diff somefile and found that svn thinks I changed the entire file ! In Textmate, I went to Textmate -> Preferences -> Advanced -> Saving and Set Line Endings to LF (recommended). File Encoding is set to UTF8 (recommended). I guessed that this was the correct s...

prefer windows or unix line ending for code?

I writing code that should compiled and run on both Windows and unix like Linux. I know about difference between line endings, but question is which to prefer for my code? Does it matter? I want it to be consistent - say all my code uses LF only, or is it better CRLF only? Are there critaria for comparing? If it matters mostly I care fo...

How to find/fix files with MIXED line endings (0x0d 0x0d 0x0a)

I know I can "probably" fix them by using "flip -u" (cygwin flip) which basically removes one of the 0xd's leaving the file with DOS style line endings (0x0d 0x0a) (of course, technically speaking this might be considered a bug!). But the other side of it is that i'd like to do this selectively, ensuring that what I'm fixing really is a...

How can I normalize the EOL character in Java?

I have a linux server and many clients with many operating systems. The server takes an input file from clients. Linux has end of line char LF, while Mac has end of line char CR, and Windows has end of line char CR+LF The server needs as end of line char LF. Using java, I want to ensure that the file will always use the linux eol char L...

Configure Visual Studio with UNIX end of lines?

Hi, We would want to have Visual Studio 2005 working on a local copy of a SVN repository; this local copy has been checked out by Mac OS X (and updates and commits will only be made under Mac OS X, so no problem with that), and as a consequence the end of lines are UNIX. We fear that Visual Studio will introduce WINDOWS end of lines. I...

What's the difference between \n and \r\n?

They both mean "new line" but when is one used over the other? ...

git diff - show me line ending changes ?

For some reason my editor looks like it is occasionaly changing changing the line endings of my source files. When I do 'git diff', all i get is a mysterious empty '-' followed by a '+', but no information to confirm this was teh actual change. How do I get git diff to show me what this change actually was ? ...

How can I setup git to checkout some files crlf, others lf?

I have a git repository which contains (among others) *.wse text files and *.sh text files. How can I setup git to always checkout *.wse files with CRLF line endings and *.sh files with LF line endings? ...

JSch sftp Transfer Stripping Windows Line Endings

I think I understand the difference between ASCII mode and Binary mode on regular FTP transfers -- in Binary mode the file is copied exactly, and in ASCII mode the client may modify line endings (stripping the Carriage Return from Windows -> UNIX or adding it in the other direction). However, I thought that the SFTP protocol only support...