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
13
votes
9 answers

How to find out which line separator BufferedReader#readLine() used to split the line?

I am reading a file via the BufferedReader String filename = ... br = new BufferedReader( new FileInputStream(filename)); while (true) { String s = br.readLine(); if (s == null) break; ... } I need to know if the lines are separated by…
chacko
  • 5,004
  • 9
  • 31
  • 39
13
votes
4 answers

How do you get Notepad++ to show separate lines when /r/n is in the text?

I've pasted some XML into Notepad++. The pasted text contains \r\n wherever a newline is supposed to occur. However, Notepad++ is just showing the entire file on a single line. It is as if it is ignoring the \r\n So the text look like this: Some…
Curtis
  • 5,794
  • 8
  • 50
  • 77
12
votes
2 answers

Why does .gitattributes not override core.autocrlf configuration on Linux?

While setting up Git for a project, I've noticed that the line-ending normalization works a bit different on Linux and on Windows. As I understand the Git documentation on this subject, the behavior on Windows is the correct one. Specifically, when…
jgreen81
  • 705
  • 1
  • 6
  • 14
12
votes
2 answers

Change Line Feeds from CRLF to LF in Eclipse

I recently noticed that the line-feeds of files in my project are CRLF but I want them as LF.(I get the following message from GIT GUI : "UTF-8 Unicode text, with CRLF line terminators" How can I solve this problem?
Berkay Özerbay
  • 149
  • 1
  • 1
  • 6
11
votes
7 answers

Newline character omitted while reading from buffer

I've written the following code: public class WriteToCharBuffer { public static void main(String[] args) { String text = "This is the data to write in buffer!\nThis is the second line\nThis is the third line"; OutputStream buffer =…
n_g
  • 3,315
  • 8
  • 25
  • 29
11
votes
1 answer

Serial port binary transfer changes carriage return

I have been trying to implement a primitive serial file transfer protocol in C this past week and I've come across a really weird problem which I can't seem to find the solution for online. I've managed to transfer binary data over the serial port…
patrick_star
  • 321
  • 2
  • 12
10
votes
4 answers

css - multi line line-clamp (ellipsis) doesn't work

problem image I applied this class to h3 tag. .ellipsis-2 { $lines: 2; $line-multiple: 1.3; $font-size: 1em; display: block; display: -webkit-box; max-height: $font-size * $line-multiple * $lines; line-height: $font-size *…
hagfish1210
  • 115
  • 1
  • 1
  • 7
10
votes
3 answers

What is a reverse line feed?

What I want to know is two points as below: What is a reverse line feed? What is the difference between reverse line feed and line feed? Is there anyone can give me an example or make an explanation?
Alex Locanda
  • 165
  • 1
  • 7
9
votes
3 answers

How to avoid CRLF (Carriage Return and Line Feed) in Logback - CWE 117

I'm using Logback and I need to avoid CRLF(Carriage Return and Line Feed) when I log a user parameter. I tried to add my class, which extends ClassicConverter, on the static map PatternLayout.defaultConverterMap but It didn't work. Thank you,
8
votes
3 answers

\n and \r seem to work everywhere. Why is line.separator more portable?

I was just perusing through questions, and I found System.getProperty(line.separator) used in place of \n with the author's comment that the code was "portable". Reading through various forums, I've seen two groups: People who say there's a…
Wolfpack'08
  • 3,982
  • 11
  • 46
  • 78
7
votes
5 answers

How do I remove line feed characters when selecting data from SQL Server?

I insert data that contains a line feed character into the database. Then I retrieve that data. I am using this script to attempt to remove the line feed while selecting the data from SQL: Select Replace(Replace stringname,char(10),'',char(32),''))…
charu
  • 389
  • 2
  • 4
  • 12
6
votes
5 answers

Preserving special chars in xml

I've an xml string stored in the db table with line feed characters. In my C# 3.5 program, I load and manipulate it using Linq to xml and then show it as a string in the textbox control on the UI form. I need to indent this xml as well as preserve…
user40907
  • 1,532
  • 5
  • 24
  • 33
6
votes
3 answers

How to break lines properly which contain both CJK and english characters in WordPress?

I found that CJK article in my wordpress4.7 can't break lines properly,which contain both CJK and english characters. Here is the article before publish. All the lines breaked properly before publish. Now it displayed as below after…
showkey
  • 482
  • 42
  • 140
  • 295
5
votes
0 answers

When piping a file in windows to a python script, my \r are deleting my characters

I have a file like this: A\r B\n C\r\n. (By \r I'm referring to CR, and \n is LF) And this script: import fileinput for line in fileinput.input(mode='rU'): print(line) When I call python script.py myfile.txt I get the correct…
Manuel
  • 478
  • 8
  • 20
5
votes
3 answers

Java: How read a File line by line by ignoring "\n"

I'm trying to read a tab separated text file line per line. The lines are separated by using carriage return ("\r\n") and LineFeed (\"n") is allowed within in tab separated text fields. Since I want to read the File Line per Line, I want my programm…
Del
  • 119
  • 1
  • 1
  • 8
1 2
3
20 21