tagged [newline]

Regex to match more than 2 white spaces but not new line

Regex to match more than 2 white spaces but not new line I want to replace all more than 2 white spaces in a string but not new lines, I have this regex: `\s{2,}` but it is also matching new lines. Ho...

10 Apr at 09:49

Why does "\n" give a new line on Windows?

Why does "\n" give a new line on Windows? The line-break marker on Windows should be `CR+LF` whereas on Unix, it's just `LF`. So when I use something like `Console.Write("line1\nline2");`, why would i...

5 Apr at 19:12

'^M' character at end of lines

'^M' character at end of lines When I run a particular SQL script in Unix environments, I see a '^M' character at the end of each line of the SQL script as it is echoed to the command line. I don't kn...

R - do I need to add explicit new line character with print()?

R - do I need to add explicit new line character with print()? How do I use the new line character in R? ``` myStringVariable

26 Jan at 13:55

How To Use \n In a TextBox

How To Use \n In a TextBox I'm developing a program that I'm using a string(`generatedCode`) that contains some `\n` to enter a new-line at the textBox that I'm using it(`textBox1.Text = generatedCode...

17 Nov at 19:59

Using new line(\n) in string and rendering the same in HTML

Using new line(\n) in string and rendering the same in HTML I have a string say in Jquery, I am trying to use quite clearly I am expecting my msg to be displayed in 2 lines, but instead \n is being di...

25 Feb at 10:59

How to add line break for UILabel?

How to add line break for UILabel? Let see that I have a string look like this: How do I make it so that the UILabel display the message like this > AAAAA BBBBB CCCCC I don't think `\n` is recogni...

-bash: syntax error near unexpected token `newline'

-bash: syntax error near unexpected token `newline' To reset the admin password of SolusVM I am executing [the following command](https://documentation.solusvm.com/display/DOCS/Generate+New+Admin+Pass...

23 Apr at 22:31

Eclipse and Windows newlines

Eclipse and Windows newlines I had to move my Eclipse workspace from Linux to Windows when my desktop crashed. A week later I copy it back to Linux, code happily, commit to CVS. And alas, windows newl...

16 Aug at 13:18

Converting newline formatting from Mac to Windows

Converting newline formatting from Mac to Windows I need a conversion utility/script that will convert a .sql dump file generated on Mac to one readable on Windows. This is a continuation of a problem...

How can I insert a line break into a <Text> component in React Native?

How can I insert a line break into a component in React Native? I want to insert a new line (like \r\n, ) in a Text component in React Native. If I have: Then React Native renders `Hi~ this is a test ...

26 Oct at 09:0

write newline into a file

write newline into a file considering the following function what to add to make it to write each tim

13 Dec at 15:44

Pass a PHP string to a JavaScript variable (and escape newlines)

Pass a PHP string to a JavaScript variable (and escape newlines) What is the easiest way to encode a PHP string for output to a JavaScript variable? I have a PHP string which includes quotes and newli...

8 Jan at 18:4

How to replace a character by a newline in Vim

How to replace a character by a newline in Vim I'm trying to replace each `,` in the current file by a new line: But it inserts what looks like a `^@` instead of an actual newline. The file is not in ...

12 Apr at 13:18

CSV in Python adding an extra carriage return, on Windows

CSV in Python adding an extra carriage return, on Windows The above code generates a file, `test.csv`, with an extra `\r` at each row, like so: instead

13 Mar at 13:3

Removing trailing newline character from fgets() input

Removing trailing newline character from fgets() input I am trying to get some data from the user and send it to another function in gcc. The code is something like this. However, I find that it has a...

14 Mar at 06:23

Replace CRLF using powershell

Replace CRLF using powershell Here is my powershell script: ``` $original_file ='C:\Users\abc\Desktop\File\abc.txt' (Get-Content $original_file) | Foreach-Object { $_ -replace "'", "2"` -replace '2', ...

22 Feb at 04:19

c# /// summary, SINGLE line break (IntelliSense)

c# /// summary, SINGLE line break (IntelliSense) If I use the `` statement in a C# `///summary`, I get a blank line and then the text goes on, which is equivalent to two line breaks (`` or \n). Howeve...

9 Oct at 19:12

How to render decoded HTML in a (i.e. a <br>) in GridView cell

How to render decoded HTML in a (i.e. a ) in GridView cell I'm binding a GridView to an LINQ query. Some of the fields in the objects created by the LINQ statement are strings, and need to contain new...

18 Mar at 12:56

How to find out line-endings in a text file?

How to find out line-endings in a text file? I'm trying to use something in bash to show me the line endings in a file printed rather than interpreted. The file is a dump from SSIS/SQL Server being re...

Writing new lines to a text file in PowerShell

Writing new lines to a text file in PowerShell I'm creating an error log file. This is my current code: ``` Add-Content -path $logpath $((get-date).tostring() + " Error " + $keyPath ` + $value + " ke...

29 May at 17:23

Using tr to replace newline with space

Using tr to replace newline with space Have output from `sed`: Those two strings should be merged into one and separated with space like: Two strings are pipelined to `tr` in order to replace newline ...

7 Mar at 01:53

NewLine in object summary

NewLine in object summary Greetings When setting a summary for a property / field / method etc.. is it possible to have a newline in it? When I set this it shows as on mouse over: > But I want it to s...

19 May at 15:37

Render a string in HTML and preserve spaces and linebreaks

Render a string in HTML and preserve spaces and linebreaks I have an MVC3 app that has a details page. As part of that I have a description (retrieved from a db) that has spaces and new lines. When it...

C# - how to remove ctrl M characters when transferring files from windows to unix using Tectia?

C# - how to remove ctrl M characters when transferring files from windows to unix using Tectia? In a C# module, I want to transfer files from Windows to Unix using Tectia. But the problem is when thes...

24 Jan at 12:34