Computing.Net > Forums > Unix > delete blank line thro vi editor

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

delete blank line thro vi editor

Reply to Message Icon

Name: wowthatnice
Date: January 31, 2003 at 00:50:52 Pacific
OS: redhat8
CPU/Ram: 256
Comment:

Hello Guru,

How can I search and delete any blank lines within a file by vi editor?

thanks



Sponsored Link
Ads by Google

Response Number 1
Name: Frank
Date: January 31, 2003 at 01:21:48 Pacific
Reply:

Hi,

just use

:g/^$/ d

in command modus.

No RISK no fun
Frank


0

Response Number 2
Name: wowthatnice
Date: January 31, 2003 at 01:41:31 Pacific
Reply:

thanks Frank,
It work just like cham.

Since here I want to ask, if I have a list of MAC something like this ABCD.EFDH.IJHK and want to substitute to this
AB:CD:EF:DH:IJ:HK what command I have to use in vi ?


0

Response Number 3
Name: Sushrut
Date: February 3, 2003 at 04:20:32 Pacific
Reply:


:%s/\(..\)\(..\)\.\(..\)\(..\)\.\(..\)\(..\)/\1:\2:\3:\4:\5:\6/g
Tested in GVIM for windows


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: delete blank line thro vi editor

Removing blank lines www.computing.net/answers/unix/removing-blank-lines/5139.html

How to delete ^M character using vi www.computing.net/answers/unix/how-to-delete-m-character-using-vi/2451.html

Vi Editor help... www.computing.net/answers/unix/vi-editor-help/6709.html