I have a bunch (hundreds) of files that are supposed to have Unix line endings. I strongly suspect that some of them have Windows line endings, and I want to programmatically figure out which ones do.
I know I can just run flip -u or something similar in a script to convert everything, but I want to be able to identify those files that ...
Is there a csh script/command to list all the files in source source tree which have line endings that show up as "^M" in emacs (under linux).
Thanks!
...
Why did DOS/Windows and Mac decide to use \r\n and \r for line ending instead of \n? Was it just a result of trying to be "different" from Unix?
And now that Mac OS X is Unix (-like), did Apple switch to \n from \r?
...
Is there an easy way to get the type of line ending that the current operating system uses?
...
It occasionally tells me:
"The line endings in the following files are not consistent. Do you want to normalize the line endings?"
Then gives me a drop down with different standards or something, Windows, Mac, Unix, and a couple Unicode.
What the hell does this mean and what is going to happen if I click 'Yes'?
...
The Javadoc for BufferedReader.readLine() says:
A line is considered to be terminated by any one of a line feed ('\n'),
a carriage return ('\r'), or a carriage return followed immediately by a linefeed.
I need slightly better control than this (e.g. I would like to be able to specify that an end of line is "\r\n", so that an "\n"...
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, applying this config after the fact doesn't seem to affect files that were committed to t...
When I run "svn propedit svn:ignore ." at the root of my svn repository, I get this error:
svn: Inconsistent line ending style
I have tried to run this script: http://blog.eflow.org/archives/130 which runs dos2unix and sets the eol-style on all of the files, however this problem still persists. Any idea what could be wrong?
...
I have some code in a python string that contains extraneous empty lines. I would like to remove all empty lines from the string. What's the most pythonic way to do this?
Note: I'm not looking for a general code re-formatter, just a quick one or two-liner.
Thanks!
...
I and my collegues are having terrible trouble getting git to behave properly with certain files on our Windows repostiory clones. The clones have been made by cloning a repository which originates on an OSX machine. We have set autocrlf to true, but the problem is that we reguarly find files that git thinks are changed even though we ...
How are \r and \n different. I think it has something to do with Unix vs. Windows vs. Mac, but I'm not sure how exactly they're difference, and which to search for/match in regexes.
...
I'm trying to use the SQL Server bcp utility to import a text file from a samba share. bcp is choking on the Unix line endings. I'm sure I could add an intermediate step, either on Unix or Windows, to change the line endings to Windows-style. But I would prefer to import the files from Unix without modification.
Anybody know if there's ...
I just finished converting a Subversion repository to git using
git svn clone--stdlayout --authors-file=ourcommitters.txt svn://svn.internalserver.com
While doing so, I had the git flag 'core.autocrlf' set to 'true' - just in case that matters.
After a long time, the command finished. I cleaned the resulting git repository a bit (del...
Git on Windows w/ Cygwin is fraught with dangers. However there's one that's really starting to bug me.
It's related to the core.autocrlf=true behaviour. After spending a week trawling the 'net it became clear that the problems you'll encounter are less bad with this set. However, if a file has a line with trailing whitespace on the end...
I cannot get this to work. I have opened a SQL Server Express table in SQL Server Management Studio 2005. When I try to paste a multiline text snippet into an NTEXT field it gets truncated to only include the first line.
In Access these kind of things works, what should i do?
...
I'm using the ASP Classic ReadLine() function of the File System Object. All has been working great until someone made their import file on a Mac in TextEdit. The line endings aren't the same, and ReadLine() reads in the entire file, not just 1 line at a time.
Is there a standard way of handling this? Some sort of page directive, or ...
I use Windows, Mac OS X and linux on a daily basis. I use git in all these environments, pulling from repos that are used by folks with different choices for line endings.
Are there definitive recommendation for setting core.autocrlf in my situation?
...
I have an ASP.Net page with a multi-line textbox on it.
Will the line endings on this textbox be according to the server or the client? What I'm asking is if ASP.Net is running in Linux on Mono will the line endings always be \n or will it depend on if the client computer is running Linux?
Are line endings in a textbox determined by t...
ifstream::tellg() is returning -13 for a certain file.
Basically, I wrote a utility that analyzes some source code; I open all files alphabetically, I start with "Apple.cpp" and it works perfectly.. But when it gets to "Conversion.cpp", always on the same file, after reading one line successfully tellg() returns -13.
The code in questi...
I'm working on a Python script that will upload a bunch of files to an FTP site. To check to see whether the file has changed, I'm comparing file sizes. The problem is, the files I'm uploading have \r\n line endings, but transferring via FTP (ascii mode to a Linux box) converts to \n line endings. Obviously I'm losing a bunch of bytes in...