<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Find and Replace]]></title><description><![CDATA[<p dir="auto">Is there a way to do a replace by column number<br />
example - i have a txt file and i need to replace whatever characters are incolumns 220-222 in each row with —</p>
<p dir="auto">Is there a way to do that? regular find/replace wont work because each line is different in those spaces</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/10568/find-and-replace</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 14:50:33 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/10568.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 22 Sep 2015 15:51:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Find and Replace on Tue, 22 Sep 2015 18:02:06 GMT]]></title><description><![CDATA[<p dir="auto">Hello <strong>Linda</strong>,</p>
<blockquote>
<p dir="auto">regular find/replace wont work because each line is different in those spaces</p>
</blockquote>
<p dir="auto">I don’t understand very well ? May be, your text contains some <strong>tabulation</strong> character, which don’t match the <strong>same physical space</strong> length ?</p>
<p dir="auto">If so, I would advice you, to replace, <strong>first</strong>, any <strong>tabulation</strong> by the corresponding amount of <strong>space</strong> characters, with the menu command <strong>Edit - Blank Operations - TAB to Space</strong></p>
<p dir="auto">Then, taking your <strong>previous</strong> example, just perform a simple <strong>regular</strong> search/replace operation like, <em>for instance</em> :</p>
<ul>
<li>
<p dir="auto">SEARCH = <strong><code>^.{219}\K...</code></strong> and  REPLACE = <strong><code>EMPTY</code></strong> to <strong>delete</strong> from the <strong>220th</strong> till the <strong>222th</strong> characters</p>
</li>
<li>
<p dir="auto">SEARCH = <strong><code>^.{219}\K...</code></strong> and  REPLACE = <strong><code>ABC</code></strong> to insert a <strong>fixed</strong> string between the <strong>220th</strong> column till the <strong>222th</strong> column</p>
</li>
<li>
<p dir="auto">SEARCH = <strong><code>^.{219}\K(...)</code></strong> and  REPLACE = <strong><code>[\1]</code></strong> to <strong>surround</strong> the characters, between the <strong>220th</strong> and the <strong>222th</strong>, with two <strong>square brackets</strong></p>
</li>
</ul>
<p dir="auto">IMPORTANT :</p>
<p dir="auto">Due to the special <strong><code>\K</code></strong> syntax, <em>you must use a <strong>global</strong> replacement</em>, clicking on the <strong>Replace All</strong> button</p>
<hr />
<p dir="auto">If you prefer use a <strong>step-by-step</strong> replace operation, the different <strong>S/R</strong>, above, should be <strong>rewritten</strong> as below :</p>
<ul>
<li>
<p dir="auto">SEARCH = <strong><code>^(.{219})...</code></strong> and  REPLACE = <strong><code>\1</code></strong> to <strong>delete</strong> from the <strong>220th</strong> till the <strong>222th</strong> characters</p>
</li>
<li>
<p dir="auto">SEARCH = <strong><code>^(.{219})...</code></strong> and  REPLACE = <strong><code>\1ABC</code></strong> to insert a <strong>fixed</strong> string between the <strong>220th</strong> column till the <strong>222th</strong> column</p>
</li>
<li>
<p dir="auto">SEARCH = <strong><code>^(.{219})(...)</code></strong> and  REPLACE = <strong><code>\1[\2]</code></strong> to <strong>surround</strong> the characters, between the <strong>220th</strong> and the <strong>222th</strong>, with two <strong>square brackets</strong></p>
</li>
</ul>
<p dir="auto">Hope that helps you a bit !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
<p dir="auto"><strong>P.S.</strong> :</p>
<p dir="auto">The nice thing, about the <strong><code>\K</code></strong> syntax, is that <strong>anything</strong> that matched <strong>before</strong> the <strong><code>\K</code></strong>  form, is <strong>forgotten</strong> by the regex engine! So, in the examples above, the <strong>matched</strong> string <strong><code>(...)</code></strong> is, <strong>ONLY</strong>, the <strong>three</strong> characters, at positions <strong>220</strong>, <strong>221</strong> and <strong>222</strong> :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/11466</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/11466</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 22 Sep 2015 18:02:06 GMT</pubDate></item></channel></rss>