The tag has no wiki summary.

learn more… | top users | synonyms (1)

0
votes
1answer
35 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
35 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
33 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
17 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
32 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
71 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
57 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
112 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
38 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
1k 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
90 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 ...
0
votes
2answers
134 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
108 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 ...
0
votes
1answer
678 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
64 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 ...
0
votes
1answer
95 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
93 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
156 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
409 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
1k 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
534 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, ...
1
vote
2answers
91 views

Newlines while saving variable to file - bash

I have mulitiple ip adresses in a variable. ActiveIPs= 192.168.0.1 192.168.0.2 192.168.0.3 I want to save them to a file like this 192.168.0.1 192.168.0.2 192.168.0.3 how do i do this?
0
votes
2answers
1k 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 ...
3
votes
1answer
396 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
212 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
191 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
895 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
187 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 ...
0
votes
1answer
566 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
2k 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
641 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 ...
14
votes
4answers
14k 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'?
3
votes
2answers
7k 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 -- ...
6
votes
1answer
4k 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 ...
16
votes
2answers
1k views

What is the magic separator between filenames in ls output?

The output of ls (with no arguments) appears to separate filenames with linebreaks. Evidence: ls | grep foo works as expected, with grep treating each filename as a separate line of input. ls > ...
2
votes
3answers
4k views

How can I replace all \r\n with \n using Komodo Edit

Somehow, some 40 files (mostly Python modules) in my project have \r\n (Windows style) as line endings. I'd like to change them to \n (Unix style) line endings, but Komodo Edit doesn't appear to ...
1
vote
1answer
148 views

Why is xkvbd eating newlines when I it is fed from xsel?

I have this script that I assign t oa keyboard shortcut to simulate pasting through middle click: #!/bin/bash aa=0 for randstring in `xsel` do if [[ "$randstring" =~ [ěščřžýáíéúůóťďň] ]] then ...
5
votes
3answers
8k views

Windows Notepad and Notepad++ show newlines in same file differently

I created a Perl script which gets some data and inserts it line by line to a text file. When I open that file with Notepad++, it appears to have an empty line separation between each two lines of ...
1
vote
3answers
16k views

How are \n and \r handled differently on Linux and Windows?

I think \n moves the needle down, and \r moves the needle to the beginning of a line (left align)? I'm not sure, though. So, if I'm wrong please correct me.... Anyway, I was told that Windows and ...
1
vote
3answers
765 views

Line feeds (0x0A) transform into carriage returns (0x0D) during email file transfer

I’m sending a file via email from a Mac (Snow Leopard) to another Mac (Lion). It turns out that all the line feeds (0x0A) in the file transform into carriage returns (0x0D), effectively turning the ...
1
vote
1answer
434 views

Avoiding newlines when copying wrapped text in Terminal.app

I have text files with lines that of length greater than my terminal width. I generally use less to view these files and often want to copy something that wraps from one line to the next. I've found ...
2
votes
1answer
651 views

How to show CR in Geany

Can Geany be switched into a mode where it displays CR characters (but not LF characters)? Can Geany be forced to only wrap a line on LF but not on CR? Generally speaking: Geany wraps a line on all ...
6
votes
1answer
392 views

How to display new line character (^J) in emacs replace query

Say I want to replace all the new lines in my emacs buffer with the character k (wait for the -1, read the rest! :) ). I know I can type M-x replace-string RET C-q C-j RET k. It works fine. My ...
0
votes
4answers
8k views

How do I insert line breaks into a text file - not programming, not fixed width - via find & replace

This is a different from someone else's similarly-titled question. Neither Excel nor OpenOffice allow users to specify line delimiters, so I'm trying to replace semi-colons with line breaks. How do I ...
2
votes
1answer
1k views

How do I change or replace all instances of a character in a text file to a newline/line break/EOL in Notepad2 or Notepad++?

I tried Notepad2's 'Replace Text' function, but I don't know what to put in the 'Replace with' field. The OS I'm using is Windows 7.
3
votes
3answers
1k views

how to find (grep) paragraph start with word and ending with other word and ignore new line?

I want to find a paragraph is a list of files. For example an SQL statement which looks like: upadte b_table set number = 100014 where id in ( select number_desc from t_table ...
0
votes
1answer
1k views

Word 2007 line breaks

I am just using the default template in Word 2007, but it seems something is strange with linebreaks. If I copy text to a formfield where there will be a linespace in word there will only be a ...
3
votes
2answers
604 views

Ignore carriage return for a specific file with Git

I use multiple environments thanks to virtual machines, and my code directory is shared between them. I also like my code to have the native (host) line endings. When I'm on a Windows host, I ...
0
votes
2answers
803 views

How to fix Windows new line character on SFTP synchronization in Eclipse (pdt)

I have a problem with Windows new line characters being introduced into text files on Eclipse SFTP synchronization (via JCraft's SFTP plugin). I've set "New text file line delimiter" to Unix and have ...