5,140 questions
-1
votes
0
answers
45
views
How to replace string by new line in Powershell 5 [duplicate]
I have a file with some strings like below for which I want to replace the || with newline using powershell 5.1.
This is || some test || string
I've follow some advices in this thread and I'm trying ...
Advice
0
votes
0
replies
40
views
What should I replace a newline character with when newlines aren't allowed?
I'm building a hobby chess engine that communicates through the UCI protocol. This is communication done through standard out/in of the program, with each line representing a single command.
One of ...
2
votes
2
answers
165
views
What is the difference between a newline character and actually writing something in a newline?
See the following:
Case 1:
Hi\nHello
Case 2:
Hi
Hello
Both of them are found in text files. So, I did some experiments on them to figure out if there are any differences between them:
In [1]: print(&...
4
votes
2
answers
135
views
sqlite3 shell on Windows : extra carriage returns when using output redirection
Demonstrate the issue
Let's use nvim to create a text file:
> nvim C:\temp\in-file.txt
The contents of the text file:
> Get-Content C:\temp\in-file.txt
abc
bcd
cde
Now let's create a simple ...
2
votes
2
answers
115
views
PowerShell pipeline adds newline when passing to the next command
I'm trying the the Rust version of coreutils on my Windows 10 system. I renamed coreutils.exe to co.exe so that I can type less. od is the Windows version of the Linux command od [from linux man site =...
1
vote
0
answers
87
views
PhpWord and \n in line together with HTML code
Using PhpWord in my PHP project gives me issues.
I do have a variable containing CR/LF (\n) and HTML code.
Something like:
$str='<div style="font-style: italic; text-align:center">...
1
vote
1
answer
123
views
How to append all content between valid numbers
I am newer at coding and can't wrap my mind around what I'm doing wrong. This function takes in text from pdf's and starts collecting text only after a certain "search phrase" is found. Then ...
0
votes
3
answers
270
views
Requesting a RegEx pattern recommendation to match text in XML tags that spans multiple lines
Assume an XML node such as this:
<Person>
<DOB>11181928</DOB>
<LastName>Mouse</LastName>
<FirstName>Mickey</FirstName>
<City>Los Angeles&...
1
vote
2
answers
107
views
Git autocrlf retroactively
I am having some trouble with the core.autocrlf feature in Git ...
In our team, we are moving from a pure Windows to a mixed Windows and Linux environment (out of necessity). We have a codebase we ...
-6
votes
2
answers
169
views
How to make read function print everything but a new line in Bash script [closed]
I want the read function to print anything but the new line when using in Bash script.
I tried the following code, but it does not help. It still prints the new line.
Minimal reproducing code:
#!/bin/...
0
votes
0
answers
118
views
NestJS CLI always generates files with CRLF line endings even after setting VS Code and Git to LF
I'm working on a NestJS project on Windows and have configured my environment to use LF line endings globally and in my workspace. However, whenever I generate new files using the NestJS CLI (e.g., ...
2
votes
2
answers
149
views
regular expression to allow only alphanumeric characters
I want my regular expression should error out if my string contains any character other than Alphanumeric. The string should error out if there is a new line character or any white space character in ...
-1
votes
1
answer
56
views
Bash replace dot for new line [closed]
Hello i have some logs that are like this
DATE-2025-04-10.UTO244234
DATE-2025-04-09.UTO244231
DATE-2025-04-11.UTO244231
DATE-2025-04-06.UTO244222
DATE-2025-04-20.UTO142222
The input i want is
DATE-...
1
vote
1
answer
125
views
STOP RUN wmissing-newline. Can somebody explain this COBOL error?
I've recently picked up on COBOL coding and have been following Derek Banas tutorial video on it. I decided to test out the IF/ELSE coding on my own, but every time I create a new file and compile it ...
0
votes
1
answer
95
views
Why 'git diff' show ^M for same line endings?
When I did git diff a b I got:
-aaa
+aAa^M
I became interested. I did hd a and hd b and both show 0d 0a after aaa (aAa), btw editing on Linux in xed for test purposes involved changing one symbol.
...
0
votes
1
answer
28
views
ClangFormat style to handle non-idiomatic whitespace?
Are there any ClangFormat styles (or other tools) which will handle excessive newlines? With two or more newlines after the function parameter parentheses, as in the example below, none of the styles ...
3
votes
3
answers
131
views
fscanf not reading second line from file
#include <stdio.h>
#include <stdlib.h>
#define MAX_SIZE 100 // Maximum size of the arrays
int main() {
FILE *file;
int array1[MAX_SIZE], array2[MAX_SIZE];
int i = 0, j = 0;
...
-1
votes
2
answers
1k
views
how do I display \n as new line in text file?
How do I display \n as new line in text file or markdown file? I am on OSX using vscode
from what I read in this StackOverflow question
I understand that \n should just display as new line in text ...
0
votes
1
answer
49
views
Why isn't my assembly code working? (64 bit x86 ubuntu)? [duplicate]
How come this code doesn't print a new line after the first string?
1 section .data
2 queryUserNumber db 'Pick a number between 1 and 100:'
3 queryUserNumberLength equ $ - ...
0
votes
1
answer
66
views
Is there a way to forbid line breaks inside single and double-quoted strings?
I discovered today, to my horror, that Postgres accepts newline characters inside single- and double-quoted string literals:
postgres=# select 'a
postgres'# b';
┌──────────┐
│ ?column? │
├──────────┤
│...
2
votes
2
answers
108
views
PSCustomObject returns with extra return(s)
Using the documentation Everything you wanted to know about PSCustomObject
$myObject = [PSCustomObject]@{
Name = 'Kevin'
Language = 'PowerShell'
State = 'Texas'
}
$myObject
Above ...
1
vote
1
answer
200
views
Jinja2 unexpected newlines when using macros
I'm rendering some YAML code with Jinja2 and am having trouble figuring out where this newline is coming from when I call a macro.
Here is my YAML code:
names:
- Bob
- Jason
- James
Here is my ...
0
votes
1
answer
95
views
Convert Regular Expression To Oracle
I have a string of characters (an CSV file) that contains \r\n (or chr(13)||chr(10) in PLSQL) embedded in the data. I need to ingore these embedded Carriage Return Line Feeds so I can find the actual ...
4
votes
3
answers
3k
views
Cannot send Whatsapp messages with new-lines via Facebook Graph API
I want to print dynamic multiline text in whatsapp messages. The messages are sent via Facebook Graph API. I have used the \\n character to insert a new line. See request below.
Request:
POST https://...
-4
votes
1
answer
81
views
How to match invisible new lines?
I have rows in a spreadsheet that display as such
They all have invisible new lines that are only visible when editing the cell.
I can't figure out how to match them.
\n didn't match. \n only ...
0
votes
1
answer
46
views
line break on text created by createElementNS
I feel like I have a very dumb question: I create a text with the following command:
text = document.createElementNS("http://www.w3.org/2000/svg", "text")
text.textContent = "...
-2
votes
1
answer
112
views
Don't understand why newlines are getting lost after XML Serialization
From my browser, I send the following payload as a string,
<Form>
<Field Sql="select top(1)
Row
FROM
Table">
</Field>
</Form>
Notice how the value of Sql has ...
2
votes
1
answer
76
views
What is the proper charset for decoding System#lineSeparator?
Let us say we need to verify the following method.
/**
* Prints {@code hello, world}, to the {@link System#out}, followed by a system dependent line separator.
*
* @param args ...
0
votes
1
answer
120
views
"Is not terminated with newline" Ren'py
I had launched my programm, but it gave me a traceback that says: "line 9: is not terminated with newline". I don't see a mistake. Can someone explain it to me?
init:
#Название мода
...
3
votes
1
answer
288
views
Should a source file end with new line or not? What about backslash + newline?
If we don't end a source file with a new line character but just a } after main(), then the clang compiler (in strict mode
-std=c17 -pedantic-errors) infamously complains:
error: no newline at end of ...
0
votes
1
answer
123
views
Python Script read LF without CR in text file and replace with another character
I have several tab-delimited text files obtained from the FFIEC site (https://cdr.ffiec.gov/public/PWS/DownloadBulkData.aspx) <Call Reports - Single Period, Schedule RIE> that have LF (line feed)...
0
votes
0
answers
296
views
How can I traverse up and down lines contained in a gap buffer?
I'm writing a text editor as an exercise and I'm using a gap buffer as the data structure for holding text. For a cursor, I'm just storing an index into the buffer. Here is what I'm working with:
...
1
vote
3
answers
290
views
How to preserve new lines from command output printed out using Write-Host in PowerShell?
I have recently (2-3 days ago) started to use Powershell. I have a C++ application that uses argparse to process some command line arguments. If something is not as expected, my code exits with the ...
1
vote
0
answers
52
views
How to prevent punctuation marks (dots, commas) from going to new line? [duplicate]
How to stop commas, dots, brackets, etc. from going to new line?
They need to stay on the same line with the content that is immediately before them.
The svg is inserted with jQuery after the document ...
0
votes
2
answers
280
views
Python is interpreting \n as 0xd0 when reading as bytes
Newline is getting interpreted as Ð (0xd0) instead of (0x0a) and I genuinely don't have any idea on how to fix this. I don't know where to begin either.
When trying to use this code, it reads 0x0a as ...
0
votes
0
answers
396
views
Github Actions: Array String as an input from a env variable
I am using docker/build-push-action@v5 and need to pass build-contexts from variable. Its type is List of strings: https://github.com/docker/build-push-action?tab=readme-ov-file#inputs
If I specify ...
0
votes
3
answers
100
views
In batch (`.bat`), how do I set a variable to print multiple newlines?
From this other SO post, learned that
SET n=^&echo(
echo First line%n%%n%Second line
prints
First line
Second line
How do I define nn to print 2 new lines? The following didn't work
SET n=^&...
2
votes
1
answer
147
views
Git: Want to propagate (rebase) LF vs. CRLF changes through branch revisions
Say, I have a branch with several commits in it.
In versions A and B, I have a file with mixed line endings (mostly LF, but some CRLF), and made various other changes to it.
In version C, I made ...
-1
votes
2
answers
218
views
How to prevent a paste in a cell with carriage returns from overwriting the values below?
In apps script, how to prevent pasting text in a cell (keyboard shortcuts) with carriage returns from overwriting the values below?
I tried a onedit(e) function, but we cannot intercept keyboard ...
0
votes
1
answer
112
views
About writing/reading "\r\n" to/from a file
Why, if you write a string containing "\r\n" to a file opened in binary mode, and then read that string from the same file, but opened in text mode, then the string will contain '\n' ...
0
votes
1
answer
680
views
git add --renormalize does not re-checkout my files with the correct line endings
I have a repository which I use between Windows and Linux.
Currently some files, for example the file myfolder/myfile.txt is stored with CRLF (DOS) line endings and checked out with CRLF linedendigs.
...
3
votes
2
answers
94
views
convert newlines to windows newlines [duplicate]
I want to convert all newlines in my input string to windows newlines (\r\n). So I want to apply the following mapping:
\r\n -> \r\n
\r -> \r\n
\n -> \r\n
How should this be done?
0
votes
1
answer
579
views
Cannot inject newline characters into input field using Nodriver
I am using Python to automate interactions with a web application. My goal is to send newline characters into an input field to separate domain names, but all attempts have failed to properly input ...
0
votes
2
answers
652
views
Can I use Notepad++ to remove line breaks from strings and keep things neat?
I'm working on translating an old game. I have the strings displayed/organized like this
This is a
sentence that you
really need to read.<End>
This is also a
sentence that you
need to read.<...
-1
votes
2
answers
153
views
Why does `echo` interpret "\n" as new line character only in interactive shells and not when executing a shell script?
Why does echo interpret "\n" as new line character in interactive shells only and not when executing a shell script also?
Running in an interactive bash shell:
$ echo "hello\nworld"...
0
votes
1
answer
86
views
Adding variables to an API payload with new lines in Python
I am pretty new to Python, and what I'm trying to achieve is to add variables to the payload below in Python; it's meant for Zeptomail API, and I'm trying to customize and add user-specific data to ...
-1
votes
1
answer
216
views
Why isn't "\n" interpreted as newline character when a String like, "abc\nabc" is given as input via Scanner class in Java?
In Java, when we try to print a Hardcoded String like, "abc\nabc", we observe a line change after the first abc but when we take same input via sc.next() or sc.nextLine() it prints out '\n' ...
2
votes
1
answer
47
views
Why does PHP output \n instead of actually making a newline?
Why does PHP output \n here instead of actually making a newline? I'm viewing it in the terminal and saving into a text file.
It displays wrongly:
Lopende tekst...\nVolgende zin.
It should result in:
...
1
vote
2
answers
899
views
How can I use regex to replace text with a new line or CR/LF?
I'm using Phoenix Code — the editor based on Brackets — as a text editor, but this is a more general issue with search and replace and new lines in regular expressions.
I will often have several ...
0
votes
0
answers
39
views
This program is not \n terminating and keep taking input [duplicate]
This program is not \n terminating and keep taking input until the size of array is specified in condition is not reached.This program should terminate when \n is encounterd.
#include<iostream>
...