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
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?
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
Summary: Q1 & Q2: Remove Blank Line vi filename (use 'vi' edit the file) :g/^$/d (type this ex command for delete blank line) :g/#/d (type this ex command for delete any lines with '#' at the front...
Summary: Sometimes these characters are placed in a file during a DOS to UNIX conversion (these characters can only be viewed using an editor such as vi editor or using the cat –v command to view the file). T...
Summary: Hi, I have a log file of 450 MB and I want to remove few thousand lines from it before I open it i.e. without opening the file in vi editor. I know there is a way but not sure how. Greatly apprecia...