Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Jan 2004 11:27:23 -0500
From:      Greg Wooledge <greg@wooledge.org>
To:        freebsd-questions@freebsd.org, misc@openbsd.org
Subject:   Re: how to get rid of ^M character using vi
Message-ID:  <20040125162723.GQ672@griffon>
In-Reply-To: <20040125151753.GA1798@gandalf.welch.net>
References:  <BAY13-F62bUpm0RnzXo00012ad5@hotmail.com> <20040125151753.GA1798@gandalf.welch.net>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help

--5LiOUhUlsRX0HDkW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

If *every* line ends with ^M (which is almost always going to be the
case, if the file has been produced on a DOS/Windows system), then
you can just use this:

:%s/.$//

to delete the last character of each line.  This has an obvious
downside, but the advantages are that it's easier to type and to
read.

--=20
Greg Wooledge                  |   "Truth belongs to everybody."
greg@wooledge.org              |    - The Red Hot Chili Peppers
http://wooledge.org/~greg/     |

--5LiOUhUlsRX0HDkW
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAE+5rkAkqAYpL9t8RAnBDAKCSys/NasLgDNhfgIlMm+nBlQSDfwCgjrdo
/Ric5PWc4xhRl1vnsIQqrB8=
=wAJH
-----END PGP SIGNATURE-----

--5LiOUhUlsRX0HDkW--



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20040125162723.GQ672>