end-of-line

How to configure GNU Emacs to write UNIX or DOS formatted files by default?

I've had these functions in my .emacs.el file for years: (defun dos2unix () "Convert a DOS formatted text buffer to UNIX format" (interactive) (set-buffer-file-coding-system 'undecided-unix nil)) (defun unix2dos () "Convert a UNIX formatted text buffer to DOS format" (interactive) (set-buffer-file-coding-system 'undecided-d...

PHP Inserting newlines automatically

I have a php data migration script that serializes an array of text. Somehow, and this is not in my codebase, but the script is inserting \\\\\\\r\\\\\\\n into the string. Here is an example of what the output is like: Product Line: [56313] LEGO Batman Screenshot\\\\\\\\r\\\\\\\\n[5 6384] LEGO Batman Screenshot[56446] LEGO Batman Screen...

Javascript: Convert textarea into an array

How would you go about breaking up a textarea value into an array, based on the end of line separation? Use of jQuery is cool by me... ...

C++ portable end of line

Hi everyone, is there any way to automatically use correct EOL character depending on the OS used? I was thinking of something like std::eol? I know that it is very easy to use preprocessor directives but curious if that is already available. EDIT What I am interested in is that I usually have some messages in my applications that I...

check if std::cin operator>> has read the whole line

Hello, I'm implementing a little command line parser. Let's say I have a command that requires 2 parameters. I want to let the user type all 3 strings (the command and 2 parameters) on one line, as well as on several lines. Currently I'm having something like this: std::string command; std::cin >> command; std::cout << command << " ent...

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...

How to convert Windows end of line in Unix end of line (CR/LF to LF)

hi guys, I'm a Java developer and I'm using Ubuntu to develop. The project was created in Windows with Eclipse and it's using the CP1252 encoding. To convert to UTF-8 I've used the recode program: find Web -iname \*.java | xargs recode CP1252...UTF-8 this command gives this error: recode: Web/src/br/cits/projeto/geral/presentation/...

How can I print "Done" or "Fail" at the end of line to stdout in Perl?

I just have begun with Perl and I want to write my own script to scan a document and convert the resulting TIFF file to a PDF file. If the conversion succeeds (using tiff2pdf), I want to print "Done" at the end of the line, but I can't seem to find a hint to do this on the Web. My guess is that I have to get the geometry of the terminal...