Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Dec 2003 16:58:06 -0600 (CST)
From:      James Schmidt <james@JamesSchmidt.Com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Remove ^M characters from xhtml file
Message-ID:  <20031202165558.P38364@speedy.insekure.com>
In-Reply-To: <20031202225359.GA1125@moo.holy.cow>
References:  <20031201031602.GA80581@bsdjunky.homeunix.org> <20031202225359.GA1125@moo.holy.cow>

next in thread | previous in thread | raw e-mail | index | archive | help
Using Vi, use this command

:1,$ s/<ctrl-v><ctrl-m>//g

HTH
James


On Tue, 2 Dec 2003, parv wrote:

> in message <20031201031602.GA80581@bsdjunky.homeunix.org>,
> wrote Bryan Cassidy thusly...
> >
> > I've downloaded a couple of .xhtml files and they have ^M characters
> > all through it. I tried the col -b < name > newname command on these
> > files but when I do that it erases the whole document. Any ideas?
>
> Ah, a FAQ of comp.unix.* groups...
>
>   http://groups.google.com/groups?q=remove+%22%5EM%22+file+group%3Acomp.unix.*
>
>
> It pains me not to see even a mention of sed, even though i prefer the
> "perl pie" solution myself.  To rectify the situation...
>
>   #  one way to type ^M is: Ctrl-V followed by Ctrl-M
>   sed -e 's/^M$//' old > new && mv -f new old
>
>
>   - Parv
>
> --
>
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031202165558.P38364>