The tag has no usage guidance.

learn more… | top users | synonyms (1)

1
vote
1answer
8 views

Replace with a newline

Geany, like many text editors, has a Replace dialog: In the Replace with: field, how to express that I want the pattern to get replaced with a new line character?
0
votes
1answer
20 views

NodeJS: writing JSON file not having line breaks when i open in Notepad. But is pretty view with other Editors

I am writing a JSON file using NodeJS, like this: var path = "D:\\test.json" var writeContent = {"Success" : "This is a sample"} fs.writeFile(path, JSON.stringify(writeContent, null, 4), function ...
3
votes
2answers
57 views

Is there a way to echo a blackslash followed by newline in bash?

I’m trying to terminate a line with \ and have something else on a new line. At first I did this but it just prints the \n: $ echo -e "Test\\\nNewline" Test\nNewline I tried this way but it add a ...
1
vote
2answers
39 views

How do I interactively type \r\n-terminated query in netcat?

$ nc example.com 80 GET / HTTP/1.1 Host: example.com HTTP/1.1 200 OK ... It works, line separator is just 0A here instead of required 0D0A. How do I type a 0D0A-separated query in netcat? It is ...
0
votes
1answer
42 views

Change line endings and encoding of file at the same time

I have some files with Windows line endings and latin-1 encoding that I need to convert to unix line endings and utf-8. Of course I can for file in ./*.csv; do sed s'/^M//' "$file" > ...
2
votes
1answer
24 views

How to create a single GnuPG signature which works on both LF and CR/LF versions of a file?

I created a text file using only LF (line feed) at the end of each line. I then made a version of it which was identical, except it had CR/LF (carriage return / line feed) at the end of each line. ...
0
votes
2answers
44 views

Add a newline after each terminal command except at the beginning

I want to add a newline after every command I enter in the terminal. Right now, I have this line in my .bash_profile file: export PS1="\n\u$ " This works as expected: However the issue with ...
2
votes
1answer
56 views

What is Caret-At (^@) under emacs?

I'm use to seeing Caret-M (^M) under Emacs. But below, I'm seeing Caret-At (^@): The file was created by running the Crypto++ test program on OpenBSD with the command ./cryptest.exe > ...
0
votes
0answers
15 views

Sometimes my terminal screws up newlines after killing a process

When I fire up a new terminal, this is usually what it can look like: $ echo "test"; echo "blaat" test blaat But sometimes after having run a process in the terminal that I killed with SIGKILL, my ...
0
votes
1answer
38 views

Line Manipulation Reformat text Notepad++ or PSPaD

I have about 40,000 lines I need to look like first line - no paragraph marks. The trouble is, I can't use join lines then use (\d\D+)& $1\n to get like line 1 because of numbers inside of ...
0
votes
1answer
40 views

Newline command does not work in latex formula in Libre Office

I am using Libre Office Writer 4.2.8.2 in Ubuntu 14.04. When I select Insert->Object->Formula and write some formula like <some formula> newline <some formula> it renders as <some ...
0
votes
1answer
58 views

How can I paste newline-separated text into a bulleted list without creating new bullets?

I have a bulleted list in an Outlook 2010 email and I am trying to paste a newline-separated list of text items into one of the bullets. When I do this, it's bulleting each line and I don't want it ...
0
votes
3answers
118 views

Multiline && combinator operator for command chaining in batch file

I see that this operator is used in windows (and might be Linux?) to chain/combine multiple commands in one line. Commands are executed one after another, as long as preceding complete successfully ...
1
vote
2answers
348 views

Find and replace notepad++ with wildcards

I've read about 15 tutorials on regular expression however I'm clearly not getting as I've been unable to tailor it to my problem. I have one set of code which would be found in many different ...
2
votes
1answer
79 views

NotePad++ - How to remove or replace newline characters?

Within my notepad++ environment, I have the following value on a page... test me out </li> I can search and find the ending </li> value with.... \n</li> but what do I need to ...
1
vote
2answers
98 views

Why redirecting FINDSTR output produce UNIX line ending?

When I issue this command: FINDSTR /I /N "<sdk:extra>" addon.xml output is: 973: <sdk:extra> 995: <sdk:extra> 1017: <sdk:extra> 1036: <sdk:extra> 1057: ...
0
votes
1answer
378 views

Preserving newline in find/grep search results

I am recursively searching for the occurrence of php scripts being called from other files using the following script. find . -exec grep -Hn $1 {} \; | grep -v ^Binary; Works great! Now, I need ...
2
votes
0answers
46 views

Newlines in description of imported csv in Outlook Calander

I have exported a list of birthdays from excel to csv. Now I want to import them in Outlook as calander items. Everything works fine exept I can't do newlines in the desciption. I've already tried to ...
1
vote
1answer
162 views

Unix2Dos: can't stat - what does this mean, why does it happen?

I've got a txt file that has Unix newlines and needs to have Windows newlines. I try to do unix2dos filename.txt but I get Unix2Dos: Can't stat 'filename.txt'. In fact, it says Can't stat 'xxx' for ...
1
vote
2answers
26 views

How do I output a variable without changing if it has a newline or not in a shell script?

I have a shell script that takes input from another shell script. The stream gets piped in on stdin. I need to capture all the bytes of the stdin stream to a single variable in the shell script. ...
0
votes
1answer
45 views

What is the easiest way to convert a bunch of text files from LF (Unix) to CRLF (Windows) in a single run?

There is a directory tree on a Windows7 machine containing a few hundred text files that I want to convert from LF to CRLF. I already found a Win32 version of UNIX2DOS but that one accepts only one ...
0
votes
1answer
632 views

What should I do with the newlines in this CSV file so it will import properly into a database or spreadsheet?

I have a .csv file which was exported from a proprietary electronic health records database system. I was a subscriber to their service but upon ending my subscription this is how I get to keep my ...
3
votes
2answers
88 views

Match cell content based on line break

I take data from a helpline call in site and transfer it to Linux Libreoffice Calc (LC). Column C cells have 2 sets of data - two telephone numbers - 1 being the caller and 1 being the forwarded ...
0
votes
2answers
190 views

Vim: How to append even lines to odd lines

I have the following lines. 1 4 2 10 3 20 4 35 5 56 ... ...(many more lines after this) And I want to change to the following in Vim. 1 4 2 10 3 20 4 35 5 56 ... ... How can I achieve this?
0
votes
1answer
39 views

How to merge specific lines and remove specific newlines from a text that's in the form of a changelog, using vim?

I have a changelog that's like this: version 1.90 (1 newline) Released on 27 April 2014 (2 consequent newlines) Added feature x ---> (first entry for 1.90) (1 newline between ...
13
votes
3answers
2k views

Why is Vim adding a newline? Is this a convention?

If I open Vim and type itest<Esc>:wq then I get a file that has no newlines in Vim but does seem to have a newline in the code: $ vim -u NONE test.txt $ cat test.txt | hd 00000000 74 65 73 74 ...
1
vote
3answers
152 views

Standardize \n and \r in Vim's search/replace syntax

In Vim, one searches for newlines as \n, but newlines in the replacement-string must be entered as \r. I understand that there are reasons for this behavior, but for my purposes I just find it ...
4
votes
2answers
705 views

Is VIM adding the Windows newlines?

Notice the line endings from git diff: - IP_ADDR: 'http://1.2.3.4:143' + IP_ADDR: 'http://2.4.6.8:143'^M I edited this file by putting the cursor on 1 then pressing ct: and then entering the ...
1
vote
2answers
121 views

How do newlines in text files work?

When the OS stores a .txt file (for example), how does it denote whitespace or a newline? If I'm not mistaken, all data is stored on the hard drive in binary. So is there a certain binary sequence ...
1
vote
1answer
2k views

Wrong newline character over serial port (CR instead of LF)

I'm trying to talk to a device using a usb-to-serial converter on linux. Drivers are working, the device exists at /dev/ttyUSB0. There is a strange problem (checked with a null-modem cable to another ...
2
votes
1answer
79 views

How can I add an additional line break (paragraph return) to each line break found in an Open Office Document?

I have tons of text that runs together paragraph breaks like so: off the wounded, and with the same calmness and composure as before resumed the watch over his armor. But these freaks of his guest ...
1
vote
1answer
508 views

new line in heredoc disappearing in file

I'm echoing a heredoc into a file, but the line breaks are being lost Running this script #!/bin/bash NAME="$1" mkdir -p $NAME FILE=$(cat <<SETVAR name = "$NAME" type = "test" SETVAR ) ...
0
votes
2answers
122 views

Spaces in the beginning of lines in Notepad++

Is there any reason, why Notepad++ treats spaces as an average characters and thus pushes it to a new line, instead of "hiding" them at the end of line (when line-breaking mode is of course turned ...
7
votes
3answers
349 views

Vim: auto-comment in new line

Vim automatically inserts a comment when I start a new line from a commented out line, because I have set formatoptions=tcroql. For example (cursor is *): // this is a comment* and after hitting ...
0
votes
2answers
675 views

No final new line in notepad++ documents

I'm writing bash shell scripts with Unix line endings using notepad++. However, the final line never contains a new line. I must manually create it by pressing "enter" and having a blank line in my ...
0
votes
2answers
2k views

Shell Script Error using Cygwin

I got this error after execute shell script as below. $ ./script_test.sh ./script_test.sh: line 3: syntax error near unexpected token `$'do\r'' '/script_test.sh: line 3: `for ((j=0; j<"$N"; j++)) ...
1
vote
1answer
704 views

Have a txt file keep it's line breaks after being send over FTP via Curl

I'm using Curl to send a file over FTP. It is just a generated text file from a screen hardcopy command. When I cat the file, it displays correctly, it looks like this: System up for 14844 1, ...
0
votes
2answers
2k views

How can I insert a line break over 100 times for a given text string?

I got this very, very, very long text string that consists only of e-mail addresses. It's so long that it goes off my screen several pages to the right. It makes it impossible to read. It looks ...
5
votes
1answer
657 views

Copy multiple lines from Windows Command prompt without forced newlines

Is it possible to copy multiple lines from the Windows Command Prompt without it inserting a new line where each line reaches the end of the terminal? For example, if I have the following line in the ...
2
votes
3answers
313 views

Vim undoing text width formatting

I wrote a document in vim with textwidth=80. I would now like to paste this document into libreoffice for formatting. The problem is the line breaks. In libreoffice the lines are too short because of ...
1
vote
0answers
257 views

Ms-Word introduces line breaks in RTF

I'm using a template system based on RTF + Velocity. In my RTF's I've got several VTL sentences, such as: #foreach($item in $somevar.someProp)Some may-be RTF text #end If I open the RTF file with ...
0
votes
2answers
1k views

Changing the Line Ending from Unix/Linux to Windows from terminal

I have a bunch of text files created in Ubuntu and when I access them on a Windows machine using DropBox they are not properly formatted because of the Line Ending difference between Unix/Linux and ...
4
votes
2answers
1k views

Trim trailing newline in one-liner bash alias

I'm trying to write a simple alias on my Mac OS X terminal to copy the current working directory. I have this: alias cpwd="echo \`pwd\` | pbcopy; echo \"Copied \`pwd\`\"" Then I can just run the ...
0
votes
2answers
242 views

Proper line-ending for an open-source PHP project

What is the proper line-ending preferences for an open-source web project? Obviously it includes source code of PHP, HTML, CSS and Javascript. The source code is managing via Github now, and there ...
1
vote
1answer
750 views

Regular Expression Needed to Replace Javascript in HTML Files

I need a regular expression that works in Notepad++ to remove multiline javascript references in several hundred HTML files. The code I want to remove looks like this: <script ...
0
votes
2answers
5k views

How to put a line break in an equation in MS Word 2007 or newer

When working with an Equation object in MS Word 2007 or newer, is there a way to force a line break inside the equation? Using Shift Enter causes a line break, but it also breaks the equation, i.e. ...
0
votes
2answers
788 views

New line when editing text files in ubuntu terminal?

I know that to symbolize a new line, I would do echo -e "line 1 \nline 2" > text.txt. I find that using \n repeatedly can be annoying, and I would to know if there a way to actually go down a line in ...
17
votes
5answers
22k views

How do I convert a bash array variable to a string delimited with newlines?

I want to write out a bash array variable to a file, with each element on a new line. I could do this with a for loop, but is there another (cleaner) way to join the elements with \n?
4
votes
2answers
17k views

How to print new line character with echo?

I dump a string with hexdump like this 2031 3334 2e30 0a32 2032 3331 302e 000a. It is clear that 0x0a is new line character, however, when I try to echo this string out, I always got 1 430.2 2 13.0 -- ...
9
votes
1answer
6k views

Did Mac OS Lion switch to using line feeds (LF '\n') for line breaks instead of carriage returns (CR '\r')?

I switched to Lion a while back and just noticed that when I save a text file in TextEdit, it uses LF for line breaks. I looked around everywhere I could think of on my Lion computer and could not ...