<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Remove ^M characters at end of lines in vi</title>
	<atom:link href="http://www.tech-recipes.com/rx/150/remove-m-characters-at-end-of-lines-in-vi/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tech-recipes.com/rx/150/remove-m-characters-at-end-of-lines-in-vi/</link>
	<description>Computer and technology tutorials and guides</description>
	<lastBuildDate>Thu, 09 Feb 2012 21:01:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Manu</title>
		<link>http://www.tech-recipes.com/rx/150/remove-m-characters-at-end-of-lines-in-vi/comment-page-2/#comment-53393</link>
		<dc:creator>Manu</dc:creator>
		<pubDate>Fri, 20 Jan 2012 05:42:36 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-53393</guid>
		<description>Hi Everyone, 

I am new to vi. I tried removing the ^M character from the file using 

sed s/\r//g 

but it didn&#039;t work for me. I tried using (ctrl+M) instead of \r but that is also not working. whenever I press Ctrl+M it is taking me to the next line. 

I have written down my code like below:
#!/bin/sh

while read line
do
   echo &quot;$line&quot; &#124; sed s/[^0-9]//g  &gt;&gt; temp
done </description>
		<content:encoded><![CDATA[<p>Hi Everyone, </p>
<p>I am new to vi. I tried removing the ^M character from the file using </p>
<p>sed s/\r//g </p>
<p>but it didn&#8217;t work for me. I tried using (ctrl+M) instead of \r but that is also not working. whenever I press Ctrl+M it is taking me to the next line. </p>
<p>I have written down my code like below:<br />
#!/bin/sh</p>
<p>while read line<br />
do<br />
   echo &#8220;$line&#8221; | sed s/[^0-9]//g  &gt;&gt; temp<br />
done</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: #dhk</title>
		<link>http://www.tech-recipes.com/rx/150/remove-m-characters-at-end-of-lines-in-vi/comment-page-2/#comment-53201</link>
		<dc:creator>#dhk</dc:creator>
		<pubDate>Wed, 11 Jan 2012 16:03:31 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-53201</guid>
		<description>Its works
:%s/[^0-9]$//g</description>
		<content:encoded><![CDATA[<p>Its works<br />
:%s/[^0-9]$//g</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: raj malhotra</title>
		<link>http://www.tech-recipes.com/rx/150/remove-m-characters-at-end-of-lines-in-vi/comment-page-2/#comment-53015</link>
		<dc:creator>raj malhotra</dc:creator>
		<pubDate>Wed, 04 Jan 2012 09:58:17 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-53015</guid>
		<description>Thanks Lopezscu 
yours worked and it saved time greatly :)</description>
		<content:encoded><![CDATA[<p>Thanks Lopezscu<br />
yours worked and it saved time greatly :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mooselix</title>
		<link>http://www.tech-recipes.com/rx/150/remove-m-characters-at-end-of-lines-in-vi/comment-page-2/#comment-52734</link>
		<dc:creator>mooselix</dc:creator>
		<pubDate>Tue, 20 Dec 2011 21:05:32 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-52734</guid>
		<description>Uh, all you need is this. No control-characters, etc.

:%s/\r//g</description>
		<content:encoded><![CDATA[<p>Uh, all you need is this. No control-characters, etc.</p>
<p>:%s/\r//g</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tamil</title>
		<link>http://www.tech-recipes.com/rx/150/remove-m-characters-at-end-of-lines-in-vi/comment-page-2/#comment-52636</link>
		<dc:creator>Tamil</dc:creator>
		<pubDate>Fri, 16 Dec 2011 14:03:48 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-52636</guid>
		<description>Yes, It works fine, I also had the &quot;Pattern Not Found&quot; issue. Please press the following keys to have this function.

1. Type %s
2. press (ctrl + v) = it will give the (^) symbol
3. Press (ctrl + m) = it will give the ^M in blue color. 

then add rest of the symbols. It will work.</description>
		<content:encoded><![CDATA[<p>Yes, It works fine, I also had the &#8220;Pattern Not Found&#8221; issue. Please press the following keys to have this function.</p>
<p>1. Type %s<br />
2. press (ctrl + v) = it will give the (^) symbol<br />
3. Press (ctrl + m) = it will give the ^M in blue color. </p>
<p>then add rest of the symbols. It will work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Narsimulu</title>
		<link>http://www.tech-recipes.com/rx/150/remove-m-characters-at-end-of-lines-in-vi/comment-page-2/#comment-52175</link>
		<dc:creator>Narsimulu</dc:creator>
		<pubDate>Tue, 29 Nov 2011 03:39:29 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-52175</guid>
		<description>To everyone having the “Pattern not found” message: 

Please type control character twice and then type V and M.

“press control, press control, press V, press control,press control, press M”

-Narsimulu</description>
		<content:encoded><![CDATA[<p>To everyone having the “Pattern not found” message: </p>
<p>Please type control character twice and then type V and M.</p>
<p>“press control, press control, press V, press control,press control, press M”</p>
<p>-Narsimulu</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jason</title>
		<link>http://www.tech-recipes.com/rx/150/remove-m-characters-at-end-of-lines-in-vi/comment-page-2/#comment-51946</link>
		<dc:creator>jason</dc:creator>
		<pubDate>Thu, 24 Nov 2011 00:26:06 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-51946</guid>
		<description>Ok,

For those where :%s/^M//g was not working for them, I have a workaround for you.

I was finding it wasn&#039;t doing the replace, however when I compiled the file I was working on, it was complaining about the ^M which was really annoying.

I can confirm that the following though will work.

cat fileName &#124; sed s/^M//g &gt;tmp    

Just move the tmp file back to fileName and you have a file minus the ^M.</description>
		<content:encoded><![CDATA[<p>Ok,</p>
<p>For those where :%s/^M//g was not working for them, I have a workaround for you.</p>
<p>I was finding it wasn&#8217;t doing the replace, however when I compiled the file I was working on, it was complaining about the ^M which was really annoying.</p>
<p>I can confirm that the following though will work.</p>
<p>cat fileName | sed s/^M//g &gt;tmp    </p>
<p>Just move the tmp file back to fileName and you have a file minus the ^M.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: george</title>
		<link>http://www.tech-recipes.com/rx/150/remove-m-characters-at-end-of-lines-in-vi/comment-page-2/#comment-51220</link>
		<dc:creator>george</dc:creator>
		<pubDate>Tue, 01 Nov 2011 16:59:56 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-51220</guid>
		<description>Thanks very much.</description>
		<content:encoded><![CDATA[<p>Thanks very much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cesar</title>
		<link>http://www.tech-recipes.com/rx/150/remove-m-characters-at-end-of-lines-in-vi/comment-page-2/#comment-50533</link>
		<dc:creator>Cesar</dc:creator>
		<pubDate>Fri, 14 Oct 2011 17:51:02 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-50533</guid>
		<description>To everyone having the &quot;Pattern not found&quot; message:

You MUST NOT WRITE ^V ^M

^V is: &quot;press control, press V, release V, release control.&quot;
The same with ^M: &quot;press control, press M, release M, release control.&quot;

Sure it will work as sure as you are using vi/vim.</description>
		<content:encoded><![CDATA[<p>To everyone having the &#8220;Pattern not found&#8221; message:</p>
<p>You MUST NOT WRITE ^V ^M</p>
<p>^V is: &#8220;press control, press V, release V, release control.&#8221;<br />
The same with ^M: &#8220;press control, press M, release M, release control.&#8221;</p>
<p>Sure it will work as sure as you are using vi/vim.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nit</title>
		<link>http://www.tech-recipes.com/rx/150/remove-m-characters-at-end-of-lines-in-vi/comment-page-2/#comment-33963</link>
		<dc:creator>nit</dc:creator>
		<pubDate>Wed, 03 Aug 2011 11:30:00 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-33963</guid>
		<description>Thanks Lopezscu ,sed version of ur examplecat foo &#124; sed &#039;s/^M//g&#039;the &quot;cat foo &#124; col -b &gt; foo2&quot; version in below posts is not working for me</description>
		<content:encoded><![CDATA[<p>Thanks Lopezscu ,sed version of ur examplecat foo | sed &#8217;s/^M//g&#8217;the &#8220;cat foo | col -b &gt; foo2&#8243; version in below posts is not working for me</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached (User agent is rejected)
Database Caching 2/17 queries in 1.120 seconds using memcached
Object Caching 419/422 objects using memcached

Served from: www.tech-recipes.com @ 2012-02-10 05:31:13 -->
