Questions tagged [linefeed]

Linefeed, also known as LF, is a character that controls the switching to the next line.

Linefeed, also known as LF, is a character that controls the switching to the next line.

303 questions
4
votes
2 answers

Reverse line feed in Windows / Java

Is there a way to write several lines to the system console in Windows, then delete or modify them, using Java? I can write over the same line more than once using the \r carriage return character. The Cygwin command less (a text viewer) manages it…
Luigi Plinge
  • 50,650
  • 20
  • 113
  • 180
4
votes
4 answers

Accepting \r\n input C program

I would like to ask how can I accept \r\n without changing it to \\r\\n, with fgets. I want the program to translate the \r\n to a newline character instead of printing it as a string. Current code: char buff[1024]; printf("Msg for server:…
Jerry
  • 114
  • 2
  • 13
4
votes
1 answer

What is the difference between "\n" (newline) and "\r" (carriage return) in Ruby?

y = "Ruby\riscool" x = "Ruby\niscool" if x == y puts x puts y else print 'Not equal!' end The newline and carriage return character both give the same output. However, the code above is false, and triggers the else statement. I don't…
Practical1
  • 789
  • 1
  • 8
  • 26
4
votes
4 answers

What is the point of using *both* Carriage Returns and Line Feeds?

I'd have thought one was enough. But what's the point of doing CRLF (0x0D0A), when you can simply use CR (0D)? Normally, whenever I'm using strings (C++), I do this: myString = "Test\nThis should be a new line!\nAnother linefeed."; NOTE: For…
Mateen Ulhaq
  • 24,552
  • 19
  • 101
  • 135
4
votes
3 answers

"\n" being treated as a string literal in JavaScript

I have a select tag with an option tag that has a value of "\n". When that option is selected and I get the value using jQuery, JavaScript seems to be treating it as a string literal and not interpreting it as a linefeed. I have tried escaping,…
Cody
  • 85
  • 3
  • 7
4
votes
2 answers

\r\n vs \n\r what is the difference in their behavior?

I was referring to this question and understood that \n moves the cursor to next line without resetting it while \r resets the cursor but not move it to next line. And \r\n used as a new line char in Windows. So just out of curiosity, I assigned…
Ravi Amlani
  • 92
  • 1
  • 9
4
votes
3 answers

Echo text with Unix line endings from a Windows batch (.bat) script

Say I have the following batch script: For ... DO ( SET VAL=%%B IF defined VAL echo %%A=%%B >> %OUTPUT_FILEPATH% ) How could I get the echo to output using Unix (just line feed) line endings? Alternatively, could I write the file as-is then convert…
simonalexander2005
  • 4,338
  • 4
  • 48
  • 92
4
votes
2 answers

R: Getting Unix-like linebreak LF writing files with cat()

I try to write a character vector to a textfile under Windows 7 / R 3.2.2 x64, and I want unix LF - not Windows CRLF: v <- c("a","b","c") cat(nl,file="textfile.txt",sep="\n") writes > a[CRLF] > b[CRLF] >…
Marcel Boldt
  • 252
  • 2
  • 12
4
votes
2 answers

System.lineSeparator() returns nothing

What should I see when I use the following? System.out.println("LineSeperator1: "+System.getProperty("line.separator")); System.out.println("LineSeperator2: "+System.lineSeparator()); I get the following back: LineSeperator1: LineSeperator2: Is…
Gero
  • 12,993
  • 25
  • 65
  • 106
4
votes
3 answers

SAS Reading multiple records from one line without Line Feed CRLF

I have only 1 line without line feed (CRLF CRLF), the linefeed is a string of 4 characters, in this example is "@A$3" I don't need dlm for now, and I need to import it from a external file (/files/Example.txt) JOSH 30JUL1984 1011 SPANISH@A$3RACHEL…
user3142441
  • 55
  • 1
  • 3
  • 9
4
votes
3 answers

C++ Carriage return and line feed in a string

I am working with the communication for some TCP/IP connected equipment in C++. The equipment requires that the commands sent are ended with \r\n. I am using a configuration file from which I am reading the commands used in the communication. The…
user1728363
  • 349
  • 1
  • 6
  • 15
4
votes
1 answer

Line feed is showing up unexpectedly in PHP

I have spent the last several hours pulling my hair out trying to figure out the solution to this problem. I am sending an AJAX request which, up until some minor changes, worked perfectly, returning a lovely usable character to the Javascript. Now,…
Daniel Gast
  • 181
  • 13
4
votes
1 answer

Batch file to remove carriage return (New Line)

I need help to take the line breaks from my text file. example data: mango apple grapes peanut mango apple grapes peanut mango apple grapes peanut mango apple grapes peanut desired output: mango apple grapes peanut mango apple grapes peanut mango…
user1864359
  • 41
  • 1
  • 2
4
votes
1 answer

What is the standard way of adding carriage returns in line feeds to SQL queries?

What is the standard syntax for adding carriage returns in line feeds to raw SQL queries?
vfclists
  • 19,193
  • 21
  • 73
  • 92
3
votes
1 answer

MySQL: Search & Replace with target having linefeeds/carriage returns?

I'm needing to cleanup our database and need to mass replace something like this:

I'm so hot, I sometimes spontaneously combust.
J. Scott Elblein
  • 4,013
  • 15
  • 58
  • 94