Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1028.Advanced search and replace -- How to remove the trailing blank lines in the end of file?

User: Will -- 2012-11-28          << 1027  1029 >>
Hits: 1499
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to remove the trailing blank lines after the last non-blank line from text file
Input Sample:
line1
line2

line3
line4

line5
line6

line7
line8
<blank line>
<blank line>
<blank line>
Output Sample:
line1
line2

line3
line4

line5
line6

line7
line8
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open text file
2. ctrl-h open 'replace' window
* set 'search for pattern' to:

3. click 'replace', done.

Screenshot 1:  Replace_Window


Similar Examples:
How to remove leading and trailing blanks in each line in many files? (76%)
How to remove/delete all blank lines in a text file? (76%)
How to move a string from the beginning of the line to the end of the line? (71%)
How to remove duplicate lines from a text file? (70%)
How to remove/delete extra blank lines in multiple text files? (69%)
How to reverse the order of all the lines in a text file? (67%)
How to remove all lines that can be found in another file? (66%)
How to move the specified line to the end in multiple files? (64%)

Check Demo of Advanced search and replace
Keywords:
trailing  after the last  blank lines  non  blank line  blank  the last  after  last  las  remove blank line after  remove blank lines after the last line of text  remove last blank lines  remove last blank line  remove blank lines from file  remove trailing  last lines remove  remove last lines