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
237
votes
9 answers

See line breaks and carriage returns in editor

Is there a text editor on Linux that allows me to see line breaks and carriage returns? Does Vim support this feature?
usertest
  • 27,132
  • 30
  • 72
  • 94
235
votes
18 answers

Remove blank lines with grep

I tried grep -v '^$' in Linux and that didn't work. This file came from a Windows file system.
node ninja
  • 31,796
  • 59
  • 166
  • 254
227
votes
26 answers

Add line break within tooltips

How can line breaks be added within a HTML tooltip? I tried using
and \n within the tooltip as follows: Hover me However, this was useless and I could see the…
Aakash Chakravarthy
  • 10,523
  • 18
  • 61
  • 78
221
votes
7 answers

awk without printing newline

I want the variable sum/NR to be printed side-by-side in each iteration. How do we avoid awk from printing newline in each iteration ? In my code a newline is printed by default in each iteration for file in cg_c ep_c is_c tau xhpl printf "\n $file"…
Sharat Chandra
  • 4,434
  • 7
  • 49
  • 66
215
votes
21 answers

String Resource new line /n not possible?

It doesn't seem like it's possible to add a new line /n to an XML resource string. Is there another way of doing this?
Andi Jay
  • 5,882
  • 13
  • 51
  • 61
197
votes
5 answers

How to do a newline in output

How do I make \n actually work in my output? At the moment it just writes it all in 1 long block. Thanks for any help Dir.chdir 'C:/Users/name/Music' music = Dir['C:/Users/name/Music/*.{mp3, MP3}'] puts 'what would you like to call the…
babyrats
  • 1,987
  • 2
  • 11
  • 7
197
votes
15 answers

What are these ^M's that keep showing up in my files in emacs?

I think it may have to do with TextMate, but we work in a small team and are having some issues with full-file conflicts of nearly identical files in git – in one branch the files have a ^M appended to each line. What is this mysterious ^M character…
Neil Sarkar
  • 6,834
  • 8
  • 32
  • 30
193
votes
6 answers

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 newlines have polluted many files, so CVS diff dumps the entire file, even when I…
Vasu
  • 2,406
  • 3
  • 20
  • 26
175
votes
19 answers

Generating CSV file for Excel, how to have a newline inside a value

I need to generate a file for Excel, some of the values in this file contain multiple lines. there's also non-English text in there, so the file has to be Unicode. The file I'm generating now looks like this: (in UTF8, with non English text mixed in…
Nir
  • 29,306
  • 10
  • 67
  • 103
167
votes
9 answers

How do you search for files containing DOS line endings (CRLF) with grep on Linux?

I want to search for files containing DOS line endings with grep on Linux. Something like this: grep -IUr --color '\r\n' . The above seems to match for literal rn which is not what is desired. The output of this will be piped through xargs into…
Tim Abell
  • 11,186
  • 8
  • 79
  • 110
158
votes
17 answers

How can I print a string adding newlines in Java?

I have a string like "I am a boy". I would like to print it this way "I am a boy". Can anybody help me?
Md. Rashedul Hasan
  • 1,749
  • 2
  • 12
  • 8
157
votes
18 answers

How do I create a new line in Javascript?

var i; for(i=10; i>=0; i= i-1){ var s; for(s=0; s
Technupe
  • 4,831
  • 14
  • 34
  • 37
153
votes
25 answers

Importing CSV with line breaks in Excel 2007

I'm working on a feature to export search results to a CSV file to be opened in Excel. One of the fields is a free-text field, which may contain line breaks, commas, quotations, etc. In order to counteract this, I have wrapped the field in double…
jeremyalan
  • 4,658
  • 2
  • 29
  • 38
152
votes
4 answers

Stop Visual Studio from mixing line endings in files

When opening a text based file in Visual Studio 2010 it will then write my edits with CRLF instead of the line ending format of the original file. How can I stop VS from doing this? Any half decent editor should have this capability. What's worse is…
Brett Ryan
  • 26,937
  • 30
  • 128
  • 163
149
votes
12 answers

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 I had here. The issue seems to be with newline formatting in text files, but I can't find a tool…
Yarin
  • 173,523
  • 149
  • 402
  • 512