VI "delete blank lines"

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.


what am i missing?
Who is Participating?
ahoffmannConnect With a Mentor Commented:
bt707Author Commented:

also tried useing this


it just does a substitute and replaces the blank lines with blank
bt707Author Commented:

grep -v "^$" filename > newfilename

this works but still trying to find how to do it in VI
bt707Author Commented:
Thanks ahoffmann, worked Great!!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.