Questions tagged [end-of-line]

The end of a physical line

The end of a line is usually signaled by the '\n', '\r' or '\r\n' characters.

The line that has ended is the physical line, as is observed by the line-break in the visual text. This is different from the end of a logical line in programming languages, which is signaled by the ; character in many languages including the family of languages, , etc

134 questions
1
vote
1 answer

Bash. Replace with sed. End of line problem

I am trying to search and replace in file using sed. But sed seems to hate end of line special char. text=$(shuf text.txt) echo "This is text: $text" sed -i "s~%text%~$text~g" t.txt Here is what I get: This is text: line 2 line 1 line 3 line…
1
vote
0 answers

Configure Visual Studio 2019 with UNIX end of lines

How set unix lf the default end of line in visual studio 2019? editor is always showing a request for normalize inconsistent line endings. The extension LineEndingsUnifier has not support for vs2019
jdbenitez
  • 15
  • 1
  • 5
1
vote
2 answers

PHP_EOL troubles in Laravel Seeder

I tried to run the following lines inside the run() function of a Laravel seeder. $numbers = <<
cespon
  • 5,630
  • 7
  • 33
  • 47
1
vote
1 answer

Java: Trying to ignore (or skip) a Carriage-Return(\n) that isn't an End-of-Line

I successfully read in data from csv files with this code Scanner scanIt = new Scanner(new BufferedReader(new FileReader(filef))); while (scanIt.hasNextLine()) { String inputLine =…
AdeBoI
  • 15
  • 5
1
vote
2 answers

Comment lines with string possibly followed by space/tab

In a text file I want to comment out these lines: xyz xyz ... that's a certain string followed by either end-of-line or whitespace. But I want to leave these lines alone: xyz ... that's…
jcxz100
  • 61
  • 7
1
vote
0 answers

Any way to match "end of document" in a PHP regex?

... i.e. NOT to match "end of line". $ in PHP matches "end of line". This includes when you have the "m" flag. But what if you have a multi-line string and you want to match the very end of it (or for that matter the very beginning) I've done quite…
mike rodent
  • 14,126
  • 11
  • 103
  • 157
1
vote
1 answer

readline ignores \n or \r in files (text vs binary)

I have a knot in my thinking ... i am writing the int 0 to a file three times, each followed by a end of line designator (i have tried \n (0x0A) and \r (0x0D)). here is the content of the file in bytes 00 00 00 00 0D 00 00 00 00 0D 00 00 00 00 0D to…
1
vote
3 answers

How can I tell if there is an environment.newline at the end of StreamReader.Readline()

I am trying to read a text file line by line and create one line from multiple lines until the line read in has \r\n at the end. My data looks like this: BusID|Comment1|Text\r\n 1010|"Cuautla, Inc. d/b/a 3 Margaritas VIII\n State Lic. #40428210000 …
Cass
  • 537
  • 1
  • 7
  • 24
1
vote
2 answers

sed filter to substitute '!' for periods and '!!' for periods at the end of lines

I want to write a sed filter that changes all periods in its input to exclamation marks, unless the period is at the end of a line, in which case the period is replaced with 2 exclamation marks (ie. !!). So far, this is what I have: sed -e…
Sam
  • 417
  • 1
  • 6
  • 13
1
vote
0 answers

Recognizing end of pasted contents even without a terminating newline in bash

I am trying to dig list of domains so that I can look up only txt records. Here's my script. #!/bin/bash echo "Please Enter the Domains (Multiple Domains will work):" while read domains || [[ -n "$domains" ]]; do echo dig TXT $domains |…
Jay Kim
  • 11
  • 2
1
vote
1 answer

removing EOL delimiter from inserting into external table -oracle

I have included notrim for rowdata column in external table as suggesterd by Alex (This is a continuation of this question,), But now End of Line character is also appending at the rowdata column, I mean , End of line (CR-LF) is also joins at the…
theRoot
  • 571
  • 10
  • 33
1
vote
2 answers

base64 decode c++ fail end of line byte

I would like to decode a string of a large file in c++. The size of the chain is: 1827500 characters and the file is: 1370626 bytes My problem is that the decoding function does not work. The decoded file is different from the original file. Below…
OOM
  • 728
  • 7
  • 22
1
vote
1 answer

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…
Florian
  • 512
  • 1
  • 6
  • 12
1
vote
1 answer

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

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…
phunehehe
  • 8,618
  • 7
  • 49
  • 79
1
vote
2 answers

'End' key not going beyond trailing whitespace of line in Eclipse

When I press the End key (in Windows) to get to the end of the line in Eclipse, I don't get to the actual end of the line if there's trailing whitespace. Instead I get to the beginning of the trailing whitespace, and subsequently pressing End causes…
H.v.M.
  • 1,348
  • 3
  • 16
  • 42
1 2 3
8 9