Questions tagged [blank-line]

Blank-Line refers to any existence of an empty line of data or the creation of an empty line on a form created by the *enter* or *return* keys.

Blank-Line, when referring to data, is used in the description of any record in a table/query where data does not exist. This could be in reference to creating a blank line of data, or determining where a blank line of data exists.

Blank-Line, when referring to a form, is used in the description of any line which contains nothing but white space. This could be in reference to shifting data downward or upward in a form or report, or shifting controls downward or upward in a form or report.

237 questions
171
votes
12 answers

How to remove newlines from beginning and end of a string?

I have a string that contains some text followed by a blank line. What's the best way to keep the part with text, but remove the whitespace newline from the end?
Dylan Wheeler
  • 6,928
  • 14
  • 56
  • 80
168
votes
17 answers

Visual Studio Code - delete all blank lines - regex

I spent some time trying to figure out how to delete all blank lines in Visual Studio Code and I can't get it working. Anybody knows how to do it please? If I search for ^$ while typing it in search field VSC does find the blank lines (completely…
Joz
  • 1,833
  • 2
  • 12
  • 6
102
votes
6 answers

Notepad++ - How can I replace blank lines

I have a text file with a thousand lines of numbers like so: 402 115 90 ... As you can see there is a blank line in between each number that I want to remove so that I have 402 115 90 ... How can I do this?
Joeblackdev
  • 7,217
  • 24
  • 69
  • 106
76
votes
5 answers

JavaScript: how to use a regular expression to remove blank lines from a string?

I need to use JavaScript to remove blank lines in a HTML text box. The blank lines can be at anywhere in the textarea element. A blank line can be just a return or white spaces plus return. I am expecting a regular expression solution to this. Here…
curious1
  • 14,155
  • 37
  • 130
  • 231
56
votes
8 answers

How to remove blank lines from a Unix file

I need to remove all the blank lines from an input file and write into an output file. Here is my data as…
Teja
  • 13,214
  • 36
  • 93
  • 155
34
votes
4 answers

PEP8: conflict between W292 and W391

As far as I know in unix it's a good practice to always have blank line at the end of file - or to put it in other words: every line should end with \n. While checking my python code with PEP8 I noticed that it also states that there should be \n at…
seler
  • 8,803
  • 4
  • 41
  • 54
25
votes
4 answers

Replacing a text with \n in it, with a real \n output

I am trying to get a config from a juniper router and I have the following problem: After setting this stdin, stdout, stderr = client1.exec_command('show configuration interfaces %s' % SID) CONFIG = stdout.read() print CONFIG It brings me…
agusbava
  • 273
  • 1
  • 3
  • 7
24
votes
3 answers

Add Blank Line to Word Output RMarkdown

Good day. I am trying to create a conference abstract submission using a rmarkdown file which exports to a word document. I am trying to find a way to insert a blank line in the outputted word document. I have found that a line break can be inserted…
Patrick
  • 915
  • 2
  • 9
  • 26
23
votes
5 answers

How do I insert a blank line every n lines using awk?

I've got an input file like this: line 1 line 2 line 3 line 4 line 5 line 6 I'd like to use awk to insert a blank line every few lines; for example, every two: line 1 line 2 line 3 line 4 line 5 line 6 How can I get awk to put a blank line into…
frenk
22
votes
3 answers

Pylint giving me "Final new line missing"

Pylint complains on last line where I'm calling function deletdcmfiles(). Final newline missing. I'm new to python and I'm not sure what is triggering this? Here is the code of the program: ''' This program will go through all Work subdirectorys in…
Nermin Kekic
  • 393
  • 2
  • 6
  • 12
22
votes
4 answers

Empty paragraph tags - should I allow in HTML editor or not?

I'm using CKEditor 4, which seems to have a default setting of using

to indicate a blank line. Up to now, I've always seen blank lines in HTML represented by

 

- ie. not an empty tag. So CKEditor's default output representing a…
ingredient_15939
  • 3,022
  • 7
  • 35
  • 55
20
votes
2 answers

Visual Studio - blank line at the end of each new file

Why does VS add a blank line at the end of each new file I create? I use VS to create .NET projects (not C++ or something). Is there any special reason? Historical compatibility with compilers and parsers? Can I disable this??
Andrei Rînea
  • 20,288
  • 17
  • 117
  • 166
15
votes
6 answers

How to remove tabs from blank lines using sed?

I'd like to use sed to remove tabs from otherwise blank lines. For example a line containing only \t\n should change to \n. What's the syntax for this?
SundayMonday
  • 19,147
  • 29
  • 100
  • 154
15
votes
2 answers

Printing multiple blank lines in python

Is there a way that you can print more than one blank line in a programme, without having to type print("\n") load of times? For example, I want to have a blank page (about 40 lines, I think) before my next line of text
brisbass
  • 199
  • 1
  • 2
  • 8
10
votes
1 answer

IntelliJ IDEA 12 Keep Blank Lines

I have this code: private int a; private int b; private int c; But when I reformat it with IntelliJ, it changes to this: private int a; private int b; private int c; How would I allow it to keep the blank lines? But this code: private boolean…
Ramus
  • 250
  • 1
  • 2
  • 10
1
2 3
15 16