home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!rutgers!modus!gear!cadlab!albani
- From: albani@cadlab.sublink.org (Lanfranco Albani)
- Newsgroups: comp.editors
- Subject: Re: How do I remove new-lines [CR,LF] in vi?
- Message-ID: <1992Jul21.093558.26214@cadlab.sublink.org>
- Date: 21 Jul 92 09:35:58 GMT
- References: <Brnt3s.5r6@x10siv.wariat.org> <1992Jul20.085426.619@alf.uib.no>
- Organization: CAD.LAB S.p.A., Bologna, Italia
- Lines: 29
-
- buboo@alf.uib.no (Ove Ruben R Olsen) writes:
- :To remove the CRLF at the end of a line: :%s/^V^M//
- : ^
- : CTRL-V-CTRL-M
-
- Use: :%s/^V^M$//
- just in case you have some strange file format (^M in middle...)
-
- :To remove blanklines (LF): :%s/^$//
- : ^
- : NOT CTRL-$, but just ^ and $
-
- Blank lines may have blanks and tabs, and they are not visible
- unless you use :set list , so is better to use:
- :%s/^[ ][ ]*$//
- or
- :%s/^[ ]+$//
-
- Between square brackets there are a blank and a tab.
-
-
- Bye, Lanfranco
-
-
- --
- Lanfranco Albani - CAD.LAB s.p.a., v. Ronzani 7/29, Casalecchio, Italia
- Email: (work:) albani@cadlab.sublink.org, (home:) bob@allan.sublink.org
- Phone: (work:) ++39 (51) 6130360, (home:) ++39 (51) 727372;
- Fax: ++39 (51) 6130294 (work only), Fidonet: 2:332/407.1138 (home only).
-