?
Solved

VI  "delete blank lines"

Posted on 2005-05-03
4
Medium Priority
?
802 Views
Last Modified: 2013-12-26
i've deleted hundreds of lines in a file, i need to remove the blank lines.

tried doing this but can't get it right.

:%s/^$//

what am i missing?
0
Comment
Question by:bt707
  • 3
4 Comments
 

Author Comment

by:bt707
ID: 13920331

also tried useing this

:%s/^$//g

it just does a substitute and replaces the blank lines with blank lines.........lol
0
 

Author Comment

by:bt707
ID: 13920364

grep -v "^$" filename > newfilename


this works but still trying to find how to do it in VI
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 2000 total points
ID: 13920727
:g/^$/d
0
 

Author Comment

by:bt707
ID: 13920900
Thanks ahoffmann, worked Great!!!
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question