<?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: Vi and Vim Editor: 12 Powerful Find and Replace Examples</title>
	<atom:link href="http://www.thegeekstuff.com/2009/04/vi-vim-editor-search-and-replace-examples/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thegeekstuff.com/2009/04/vi-vim-editor-search-and-replace-examples/</link>
	<description>Guides, HowTos and Tips for Technology Geeks</description>
	<lastBuildDate>Thu, 09 Feb 2012 11:52:28 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: david sowerby</title>
		<link>http://www.thegeekstuff.com/2009/04/vi-vim-editor-search-and-replace-examples/comment-page-1/#comment-189278</link>
		<dc:creator>david sowerby</dc:creator>
		<pubDate>Thu, 02 Feb 2012 22:20:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=453#comment-189278</guid>
		<description>did you try:
:%s/@//g  ???
you don&#039;t need ctrl+@, @ is just an ascii character.
----------------dave</description>
		<content:encoded><![CDATA[<p>did you try:<br />
:%s/@//g  ???<br />
you don&#8217;t need ctrl+@, @ is just an ascii character.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;-dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: owahid</title>
		<link>http://www.thegeekstuff.com/2009/04/vi-vim-editor-search-and-replace-examples/comment-page-1/#comment-182548</link>
		<dc:creator>owahid</dc:creator>
		<pubDate>Mon, 23 Jan 2012 01:37:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=453#comment-182548</guid>
		<description>How can I remove @ entirely throughout the file? I can remove ^M using
:%s/^M//g
by pressing ctrl+v then ctrl+m but ctrl+@ produces ^@.
Thanks!</description>
		<content:encoded><![CDATA[<p>How can I remove @ entirely throughout the file? I can remove ^M using<br />
:%s/^M//g<br />
by pressing ctrl+v then ctrl+m but ctrl+@ produces ^@.<br />
Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bebo</title>
		<link>http://www.thegeekstuff.com/2009/04/vi-vim-editor-search-and-replace-examples/comment-page-1/#comment-178213</link>
		<dc:creator>bebo</dc:creator>
		<pubDate>Sun, 15 Jan 2012 07:35:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=453#comment-178213</guid>
		<description>awesome stuff,,,,,,,,Thanks a lot,,,,,</description>
		<content:encoded><![CDATA[<p>awesome stuff,,,,,,,,Thanks a lot,,,,,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arun</title>
		<link>http://www.thegeekstuff.com/2009/04/vi-vim-editor-search-and-replace-examples/comment-page-1/#comment-157571</link>
		<dc:creator>Arun</dc:creator>
		<pubDate>Sun, 18 Dec 2011 17:00:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=453#comment-157571</guid>
		<description>This is great, I appreciate your efforts for taking time tn explain me.

Thanks a lot,
Arun</description>
		<content:encoded><![CDATA[<p>This is great, I appreciate your efforts for taking time tn explain me.</p>
<p>Thanks a lot,<br />
Arun</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: david sowerby</title>
		<link>http://www.thegeekstuff.com/2009/04/vi-vim-editor-search-and-replace-examples/comment-page-1/#comment-157199</link>
		<dc:creator>david sowerby</dc:creator>
		<pubDate>Sun, 18 Dec 2011 01:29:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=453#comment-157199</guid>
		<description>the up arrow didn&#039;t finish up where I put it - it should be under the &#039;1&#039; after DEC
-------david</description>
		<content:encoded><![CDATA[<p>the up arrow didn&#8217;t finish up where I put it &#8211; it should be under the &#8217;1&#8242; after DEC<br />
&#8212;&#8212;-david</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: david sowerby</title>
		<link>http://www.thegeekstuff.com/2009/04/vi-vim-editor-search-and-replace-examples/comment-page-1/#comment-157198</link>
		<dc:creator>david sowerby</dc:creator>
		<pubDate>Sun, 18 Dec 2011 01:27:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=453#comment-157198</guid>
		<description>which one? :-)  I&#039;ll explain the last one:
:%s/.* /&amp;,/
this uses RE greediness to work. /.* /  -- dot, star, space pushes the pattern - anything followed by a space all the way to the last space
23456234623,23645641,A TROT ,DEC 112.34
                                                               ^
It doesn&#039;t stop at the first or second space because there&#039;s another one, the third and last one - the one we want (greediness). If there was another space followed by something after the final digits this wouldn&#039;t work. (most of the other solutions would)
/&amp;,/  of course replaces the pattern with the pattern plus &#039;,&#039;
all the best  ------------------david</description>
		<content:encoded><![CDATA[<p>which one? <img src='http://www.thegeekstuff.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   I&#8217;ll explain the last one:<br />
:%s/.* /&amp;,/<br />
this uses RE greediness to work. /.* /  &#8212; dot, star, space pushes the pattern &#8211; anything followed by a space all the way to the last space<br />
23456234623,23645641,A TROT ,DEC 112.34<br />
                                                               ^<br />
It doesn&#8217;t stop at the first or second space because there&#8217;s another one, the third and last one &#8211; the one we want (greediness). If there was another space followed by something after the final digits this wouldn&#8217;t work. (most of the other solutions would)<br />
/&amp;,/  of course replaces the pattern with the pattern plus &#8216;,&#8217;<br />
all the best  &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;david</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arun</title>
		<link>http://www.thegeekstuff.com/2009/04/vi-vim-editor-search-and-replace-examples/comment-page-1/#comment-156188</link>
		<dc:creator>Arun</dc:creator>
		<pubDate>Fri, 16 Dec 2011 07:15:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=453#comment-156188</guid>
		<description>@dave; This is amazing, but wondering how it works...
Could you please explain.

Thanks,</description>
		<content:encoded><![CDATA[<p>@dave; This is amazing, but wondering how it works&#8230;<br />
Could you please explain.</p>
<p>Thanks,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: david sowerby</title>
		<link>http://www.thegeekstuff.com/2009/04/vi-vim-editor-search-and-replace-examples/comment-page-1/#comment-155966</link>
		<dc:creator>david sowerby</dc:creator>
		<pubDate>Thu, 15 Dec 2011 21:14:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=453#comment-155966</guid>
		<description>thanks Arun, I forgot to add the best solution I found duh!
:%s/.* /&amp;,/
-------------dave</description>
		<content:encoded><![CDATA[<p>thanks Arun, I forgot to add the best solution I found duh!<br />
:%s/.* /&amp;,/<br />
&#8212;&#8212;&#8212;&#8212;-dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arun</title>
		<link>http://www.thegeekstuff.com/2009/04/vi-vim-editor-search-and-replace-examples/comment-page-1/#comment-155156</link>
		<dc:creator>Arun</dc:creator>
		<pubDate>Wed, 14 Dec 2011 09:09:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=453#comment-155156</guid>
		<description>Thanks David for your efforts :)
I will try and reply you back soon!</description>
		<content:encoded><![CDATA[<p>Thanks David for your efforts <img src='http://www.thegeekstuff.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
I will try and reply you back soon!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: david sowerby</title>
		<link>http://www.thegeekstuff.com/2009/04/vi-vim-editor-search-and-replace-examples/comment-page-1/#comment-154918</link>
		<dc:creator>david sowerby</dc:creator>
		<pubDate>Tue, 13 Dec 2011 22:19:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=453#comment-154918</guid>
		<description>well Arun I finally got back home to my computer with Vim on it so I can test what I suggested and ......you&#039;re right it didn&#039;t work. I think I forgot how &quot;greedy&quot; RE&#039;s can be. But it did give me time to think about it and I came up with these solutions:
:%s/\(\d{11},\)\(\d{8},\)\([A-Z ,]* \([0-9\.]*\)/\1\2\3 ,\4
:%s/\([0-9,]*\)\([A-Z, ]*\) \([0-9\.]*\)\1\2 ,\3
:%s/......$/,&amp;/
:%s/[0-9,]*[A-Z ,]*/&amp;,/
:%s/.\{6}$/,&amp;/
:%s/^.\{33}/&amp;,/
:%s/ / ,/g    then you have to do   :%s/ ,/ /    twice
Hopefully I transcribed those correctly :-)
have fun checking these out and happy holidays ---------------david</description>
		<content:encoded><![CDATA[<p>well Arun I finally got back home to my computer with Vim on it so I can test what I suggested and &#8230;&#8230;you&#8217;re right it didn&#8217;t work. I think I forgot how &#8220;greedy&#8221; RE&#8217;s can be. But it did give me time to think about it and I came up with these solutions:<br />
:%s/\(\d{11},\)\(\d{8},\)\([A-Z ,]* \([0-9\.]*\)/\1\2\3 ,\4<br />
:%s/\([0-9,]*\)\([A-Z, ]*\) \([0-9\.]*\)\1\2 ,\3<br />
:%s/&#8230;&#8230;$/,&amp;/<br />
:%s/[0-9,]*[A-Z ,]*/&amp;,/<br />
:%s/.\{6}$/,&amp;/<br />
:%s/^.\{33}/&amp;,/<br />
:%s/ / ,/g    then you have to do   :%s/ ,/ /    twice<br />
Hopefully I transcribed those correctly <img src='http://www.thegeekstuff.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
have fun checking these out and happy holidays &#8212;&#8212;&#8212;&#8212;&#8212;david</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Content Delivery Network via Amazon Web Services: CloudFront: static.thegeekstuff.com

Served from: www.thegeekstuff.com @ 2012-02-09 12:57:49 -->
