[ale] Carriage returns and line feeds

David Ritchie deritchie at gmail.com
Mon Mar 2 00:06:42 EST 2015


Well, LF "\n" always means end of line in a linux text file. vi/vim simply
ignores CRs...

Perhaps this will work for you in vim:

:%s/.$//  (delete the CR at the end of each line)

   or :%s/^V^M//g

which says find all cntl-M (CR's) in a line and replace with a null strings

Note the the ^V is a control-V that will tell the command to except a
control character as part of a pattern.

-- David



On Sun, Mar 1, 2015 at 11:37 PM, Alex Carver <agcarver+ale at acarver.net>
wrote:

> How do you propose to mark the end of a line when \r\n is the end of the
> line?
>
> On 2015-03-01 20:26, Terry wrote:
> > Is there a way to remove all the \r\n embedded in a txt file except the
> ones at the end of each line?
> >
> > Thanks,
> >
> > Terry Bailey
> >
> >
> > Sent from my iPad
> > _______________________________________________
> > Ale mailing list
> > Ale at ale.org
> > http://mail.ale.org/mailman/listinfo/ale
> > See JOBS, ANNOUNCE and SCHOOLS lists at
> > http://mail.ale.org/mailman/listinfo
> >
> >
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20150302/c0bba380/attachment.html>


More information about the Ale mailing list