Questions tagged [newline]

Newline refers to a character sequence representing a line break in text (also known as End of Line, EOL, or Line Break). Different operating systems have different sequences for newlines.

Newline refers to a character sequence representing a line break in text (also known as End of Line, EOL, or Line Break). Different operating systems have different sequences for newlines.

5080 questions
2
votes
3 answers

Python: words in a string get stripped in the output

I'm writing a text adventure in Python 2.7 and now want to make nice-looking output. I already tried to make a GUI with Tkinter, but it didn't work, because the user's text input could not be decoded in Tk, and I need it for German Umlauts. So now…
2
votes
1 answer

Newline character(\n) in scanf

Suppose i write the code below: #include int main() { int a,b; scanf("%d\n",&a); printf("%d",a); return 0; } The input is taken and the cursor is blinking in the next line without printing the value of a. But if I remove…
Maths Maniac
  • 83
  • 1
  • 7
2
votes
3 answers

How to prevent .Net SOAP Serialization from eating NewLines

I'm using the built-in SOAP support in .Net through a wrapper class generated by Visual Studio from a WSDL. Now, when I call one one of the methods on the wrapper and pass an object that contains a string with CRLF (\r\n), only the LF (\n) will end…
Oliver Salzburg
  • 21,652
  • 20
  • 93
  • 138
2
votes
2 answers

JavaScript and array of strings containing \r and / or \n characters

I have a dynamically generated array from a database. Basically it's an array of objects which PHP prints out to the page in the section. The final output is somrthing like: var arPersons=[{'name':'aaa',description:'2-3 lines text in 300px wide…
Francisc
  • 77,430
  • 63
  • 180
  • 276
2
votes
1 answer

Is there an advantage to using LF over CRLF?

I created two files containing one line of identical text. One file was set to the LF newline, while the other was set to use a CRLF newline. The file using LF as the newline character was 1 byte smaller. When writing large programs, is there an…
user7691151
2
votes
3 answers

SQL Server CSV extract of tables with newline, doublequotes and commas in columns?

I extracted some 10 tables in CSV with " as the text qualifier. Problem is my extract does not look right in Excel because of special characters in a few columns. Some columns are breaking into a new row when it should stay in the column. I've been…
Hell.Bent
  • 1,667
  • 9
  • 38
  • 73
2
votes
1 answer

Trying to separate lines by looking at certain characters and judging where to separate

Using Python 3. So basically I have a piece of code that tries to look at a text file and looks for a less than sign. If it finds a greater than sign after it, and then an uppercase letter afterwards, it knows that it is the beginning of a new line…
Wake
  • 25
  • 5
2
votes
1 answer

Git : Self-made file has line-ending problems

So, I have this new repo where I'm trying to start a collaborative project. I have already pushed .gitignore and .gitattributes (handling auto-crlf) files to it. My .gitattributes file is: # Set the default behavior, in case people don't have…
2
votes
1 answer

Python email loses newline on first line only

My Python script takes a list of lists and creates the text of an email body by joining the inner lists' elements with a "," and appends each of these with a newline like so: for row in rows: emailBody += ",".join(row) + "\n" (I know that I can…
Son of a Beach
  • 1,733
  • 1
  • 11
  • 29
2
votes
2 answers

How to add text fields in different line in applet?

I have this applet (above is the image) with 2 text field. How do I separate these text fields to different lines? code import java.applet.*; import java.awt.*; public class Print extends Applet { TextField text1,text2; public void…
Shibin Raju Mathew
  • 920
  • 4
  • 18
  • 41
2
votes
1 answer

C Deleting the newline at the end of a string acting weird

So I have the following code: printf("the output is: %s.\n", intCAPass); Which prints the following: the output is: intercapass . So I tried the two following options to get rid of the newline at the end of the string…
user1527152
  • 946
  • 1
  • 13
  • 37
2
votes
1 answer

Limit number of characters in a line notepad++

For my git commits I use notepad++ and I would like to limit the number of characters in a line to 72 characters. Normally, notepad++ show a sentence in a line until \n character, but I would like to automatically enter the content to the next line…
Karim
  • 252
  • 1
  • 4
  • 17
2
votes
4 answers

Compress whitespace between attributes in an HTML tag

We just released some code to make our software a little bit more user friendly, and it backfired. Basically, we're attempting to replace newlines with
tags. The trouble is, sometimes our users will enter code like the following:
Topher Fangio
  • 20,372
  • 15
  • 61
  • 94
2
votes
0 answers

JTable: display strings with newline characters as multiple lines

I added a JTable in a JFrame using drag and drop in netbeans. I was able to display the contents of the database but it is not like what i want to display, i want strings with newlines to be display as multiple lines. i have a code here that query…
Xue
  • 53
  • 5
2
votes
4 answers

Add new line in JavaScript loop when i reaches multiples of a number

I'm trying to print the same repetitive piece of text over and over (\I[0]), but with the number inside it incrementing by 1 each time (ex: \I[0] \I[1] \I[2] etc). I've figured that out already. But what I want to do is make it so every time the…
samfortunato
  • 43
  • 2
  • 8
1 2 3
99
100