remove ^M, conver end of sting from dos to unix


cat input_filename | sed 's/r//' > output_filename

Comments (4)

AndreyVApril 6th, 2009 at 17:32

God bless sed, because I had this problem couple of days ago with ^M!

P.s.: Welcome back to blogosphere, Lev ;)

Leonid MamchenkovApril 6th, 2009 at 18:26

Also, if you happen to be editing the file in Vim, this is how you can remove the ^M:

:%s/^M//g

But use Ctrl-V Ctrl-M to generate the ^M string, not plain text ^M.

adminApril 6th, 2009 at 18:49

AndreyV Thanks. You have got a nice domain name :)

adminApril 6th, 2009 at 19:00

Leonid Mamchenkov ;)

Leave a comment

Your comment