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
0
votes
1 answer

New line didnt work in php even with double quotes and PHP_EOL

I dont know why new line didnt work with both double quotes and PHP_EOL. Above is my script. Below is the output i am…
divakar.scm
  • 1,256
  • 5
  • 21
  • 32
0
votes
2 answers

Batch trim characters at the EOL

i would like to create a batch file that goes through txt files in a directory and every line that has #EXTINF in it, remove the last 15 characters.. basically if it is possible, i would like to trim the last 15-20 characters from any lines that is…
user2314297
  • 11
  • 1
  • 5
0
votes
1 answer

Python: incorrect os.linesep on OS X

Platform: OS X Mountain Lion Python 2.7.4 I have a piece of script that needs to convert all eol characters in a string to unix style \n. I get a string supplied by Qsci.Scintilla.text() referenced to below as txt. print 'original text: %s' %…
Daniel Schreij
  • 773
  • 1
  • 10
  • 26
0
votes
3 answers

change eol character via cmd

i have a file file1in with unix eol, i have a script to do some editing in it, but the editing is done into output.txt and is renamed as file1and this changes the eol to windows/dos the code is given set uu=file1 set vv=file2 setlocal…
0
votes
2 answers

How to get the characters of a text-box after a newline in VB.Net

Right now I am building a scripting language (EngineScript). Currently you can only type a single command/function (IE: sout "Hello world") but I want to expand it. So I was wondering whether you guys knew any code to get the characters typed after…
0
votes
1 answer

Changing EOL in String based on setting

I'm trying to change the line endings of a String, depending on a setting. Basically I have Strings, mostly with LF endings, rarely something else but it happens, and I would like to be able to change them to CRLF or CR if asked, or make sure they…
Markus
  • 295
  • 4
  • 12
0
votes
1 answer

In Python: replace in a multiline file from a given point to the end of lines

new in Python (and almost in programming). I have a file with some lines, for example ... dr=%%dr mkl=%%mkl ... I want to replace the %%dr and %%mkl with zeroes in order to have, for example ... dr=0 mkl=0 ... BUT I don't know in advance which…
0
votes
1 answer

How do I get a Lemon parser to terminate itself on a newline?

Following this old tutorial, I am trying to get a lemon parser to automatically terminate parsing on an EOL token. The relevant part of the parser looks like this: start ::= in . in ::= . in ::= in commandList EOL . { printf("start ::=…
theory
  • 9,178
  • 10
  • 59
  • 129
0
votes
1 answer

Make Mecurial discard uncommitted changes

Is the following normal Mercurial behaviour? If so, how do I discard uncommitted changes? D:\hgrepo\trunk>hg st M Library\libFunc.h D:\hgrepo\trunk>hg revert --all reverting Library\libFunc.h D:\hgrepo\trunk>hg st M…
Zero
  • 11,593
  • 9
  • 52
  • 70
0
votes
0 answers

Writing to Java program from Mac Terminal

I have a small problem with the Mac terminal. I run a Java program from the terminal and try to read some stuff from the stdin using: BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Produsul:" +…
joanna
  • 743
  • 3
  • 13
  • 27
0
votes
2 answers

Does \n\r behave differently on different OS?

I have a server and a client program that talks to eachother over a socket connection. It sends strings of data that I monitor via telnet / (or terminal? on mac). It works fine, when I use my MAC as a server and my PC as a client. It does not work…
CustomCase
  • 247
  • 1
  • 4
  • 15
0
votes
1 answer

eol unix to windows in command line .bat batch

I am trying to convert text file eol to windows format from unix on windows xp machine using command line (batch file). how do I do that? what is the command for that? thanks.
babboon
  • 683
  • 3
  • 20
  • 45
0
votes
3 answers

Handle one or multiple words in Java Socket .readLine()

I am building an application where I have a server and a client that talk to each other -over telnet. (via socket). The server program is monitoring a tank of some gass, and sends temperature level and preassure level via socket to the accepted…
CustomCase
  • 247
  • 1
  • 4
  • 15
0
votes
1 answer

How to escape ^M from svn:eol-style native

We have specified eol-style:native property in our subversion repository for shell script; this gets rid of ^M characters which are included when file is edited on Windows and executed on UNIX box. But recently we ran into an issue: One shell script…
Bharat Sinha
  • 13,973
  • 6
  • 39
  • 63
0
votes
1 answer

How to affect only real EOL characters , NOT the "\n" in text

I have a string similar to this: Lorem ipsum '\n' ipsum lorem And this is new paragraph. I want to remove the EOL chars and these 2 paragraphs to become one line. BUT I dont want to affect the '\n' - which in this case is literally used (not as…
linderman
  • 149
  • 1
  • 9