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
1
vote
0 answers

How to covert CRLF to LF

I am trying to create a npm run build for a project using React and Webpack among other components that I cloned from Github. However the error message I keep getting is Expected linebreaks to be 'LF' but found 'CRLF' (linebreak-style) at…
romicodes
  • 31
  • 2
1
vote
1 answer

Why does LF and CRLF behave differently with /^\s*$/gm regex?

I've been seeing this issue on Windows. When I try to clear any whitespace on each line on Unix: const input = `=== HELLO WOLRD ===` console.log(input.replace(/^\s+$/gm, '')) This produces what I expect: === HELLO WOLRD === i.e. if there…
zavr
  • 2,049
  • 2
  • 18
  • 28
1
vote
0 answers

Delphi source code with LF only vs CRLF causing source corruption in IDE

I recently received some Delphi 2007 source code that was written by another developer. I noticed when I click on a component icon in the IDE that Delphi generates the stub code as you would expect, HOWEVER it is 'stealing' the first character from…
lgallion
  • 267
  • 3
  • 9
1
vote
1 answer

Python winreg - How to write a linefeed to a REG_SZ value

I need some assistance in writing a line feed to a registry value. The Value is of type REG_SZ. I'm able to do this manually, by adding a "0A" to each break position when modifying the hex value in the Registry, but I'm not sure how to do this…
Johan Brink
  • 333
  • 5
  • 20
1
vote
1 answer

Why do files uploaded with cURL contain part of the request header - like boundary, Content-Type - at the beginning of the file?

I am trying to upload file to a file hosting service with cURL command line utility. At first I uploaded a file with the Chromium browser, with an opened web developer console: at the network tab I looked for the appropriate line, and I clicked on…
Konstantin
  • 2,983
  • 3
  • 33
  • 55
1
vote
1 answer

Powershell: Editing all Line Feeds and Carriage Returns in a CSV file

Goal is to remove all single "Line Feeds"(LFs) and keep the "Line Feeds" which follow a Carriage Return(CR) in a csv file. I got a report which includes several LFs in one row, but I only want to keep the "CR+LF" so every row stands for one reported…
Motecer
  • 13
  • 3
1
vote
2 answers

Eclipse: Serial terminal: Treat /n as /n/r

I am using Eclipse variant called Atollic TrueSTUDIO version 9.2.0 for the STM32 platform. When I do printf("Hello World\n"); from the microcontroller, is it possible to configure the Eclipse terminal to treat the \n as a newline? Without the…
Maxim Blinov
  • 886
  • 9
  • 33
1
vote
2 answers

how to replace /r with using string.replace

I am sending json data from a textarea and then inserting it to a database a s a clob because I am working with XML. after I read the text from the database and display it in a browser, It doesn't preserve the newlines. all the newlines are…
Tornike
  • 31
  • 4
1
vote
1 answer

writing chr(13) to file gives chr(10) when read

I have a simple piece of code that breaks my mind: if __name__ == '__main__': writen_text = chr(13) file = open('bug', 'w') file.write(writen_text) file.close() file = open('bug') read_text = ''.join(file.readlines()) …
sanyassh
  • 8,100
  • 13
  • 36
  • 70
1
vote
2 answers

Creating a new csv from malformed csv (containing LF and CR characters in between a field)

I have a 4 column csv file that has one of its columns spread across multiple lines as seen below: Number#,Scenes,OkOrFail,Time(ms) 1,com.mine[scenario->GRADE_1:thsi is test is request from Eol ],OK,3613 2,com.mine[scenario->GRADE_900:MSA…
lexa
  • 35
  • 5
1
vote
1 answer

Bash seems to convert LF into LFCR

It seems that Bash converts LF to LFCR. Indeed, here is an example bellow that describes that: text=$(echo -e "foo\nbar\ntir") When setting IFS to the LF end of line: IFS=$(echo -e "\n") the \n in the string text is not interpreted such as…
moth
  • 345
  • 1
  • 13
1
vote
1 answer

VBA/VB6 Not Recognizing VbCrLf

Happy Friday everyone! I would appreciate some direction on this. I have processed an .html file as follows: strStringToClean = Replace(strStringToClean, vbCr, vbCrLf) strStringToClean = Replace(strStringToClean, vbLf, vbCrLf) …
Trip Ives
  • 71
  • 7
1
vote
0 answers

eliminating unwanted records from carriage return / line feed combination in awk

I am using GNU awk v4.2.0 from the Windows 7 x64 SP1 cmd.exe and ran into a problem with the following simple example: # calculate the Greatest common divisor of each pair of inputs BEGIN { RS="[\r\n]" } # added…
ScienceAmateur
  • 521
  • 4
  • 11
1
vote
3 answers

sed replace end of line

I'm trying to add a bunch of 0s at the end of a line. The way the line is identified is that it is followed by a line which starts with "expr1" in Vim what I do is: s/\nexpr1/ 0 0 0 0 0 0\rexpr1/ and it works fine. I know that in ubuntu \n is what…
1
vote
0 answers

String to Dict Conversion and %0a -

I am trying to convert a string to dict and for some reason, %0a gets added. Tried converting using ast and JSON modules with no luck. The strings are read from a file. Below is a sample record: {"description" : "GA", "ip" : "10.145.133.4",…