newbie: use <CR> in RE?

M.D. DeWar mark at s-wit.net
Mon Nov 24 06:29:33 PST 2003


i find this and seems to work good.
cat {filename} | tr -d '/r' > out; mv out {new filename}

It gets rid of all them ^M from the files for me.

HTH
Mark
----- Original Message ----- 
From: "Zhang Weiwu" <weiwuzhang at hotmail.com>
To: <freebsd-questions at freebsd.org>
Sent: Saturday, November 22, 2003 8:00 AM
Subject: newbie: use <CR> in RE?


> Hello. Just want to know how to use special character in Regular
Expression.
>
> I wish to remove all the carrier returns from a text file, I can use:
> tr -d "\r" < text_file > modified_text_file
> But if I do:
> sed -i s/\r//g text_file
> it actually removes all the character "r" from the file.
>
> This is also a problem in vi(1). Besides <CR> I wish to manipulate
> tabstops and line-feeds with RE too.
>
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
"freebsd-questions-unsubscribe at freebsd.org"
>




More information about the freebsd-questions mailing list