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
-2
votes
2 answers

Convert line endings to "\n" literals

I have an interesting problem to solve. Because of a tool that I have to talk to, I need to convert newlines to the literal string \n I have the following data {"name": 2019-05-25, "tracker": { "project": { "uri": "/project/87", "name": "Allen's…
Allen Fisher
  • 607
  • 2
  • 7
  • 28
-2
votes
2 answers

How to read number to string till end of the line in C

I have an input file like this 10 25 4 3 86 1 23 20 14 1 3 7 3 16 7 2 The 1st line: An array of number. The 2nd line: An integer k. I tried fgets() to read them but it's not working. Here is my code: int main(){ FILE *input =…
lamhoangtung
  • 834
  • 2
  • 10
  • 22
-2
votes
1 answer

why my not_EOL function in C cannot detect EOL

bool not_EOL (char c) { return ((c != '\n') && (c != '\0')); } while (not_EOL(gradients[i])) { // Read a position factor pair int a=sscanf(gradients + i, "(%d %lf)", &column, &factor); …
yjrye
  • 3
  • 2
-2
votes
5 answers

Detect end of line in C

This is the code which read a matrix 10x10 from a file "F1.txt" #include int main( int argc, char ** argv ) { FILE * fr; fr = fopen("F1.txt","r"); int i, j; int matrix[10][10] = {0.0}; for(i = 0; i < 10; i++) …
Luchnik
  • 1,067
  • 4
  • 13
  • 31
-5
votes
1 answer

Python simple loop EOL while scanning string literal

I am trying to write out line by line of a text file however I keep getting the following error: File "E:\Print\test.py", line 8 print "(lines) SyntaxError: EOL while scanning string literal myfile = open('log.txt', 'r') count = 0 while 1: …
Steve Barrett
  • 21
  • 1
  • 2
  • 3
1 2 3
25
26