<?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 increment by 1]]></title><description><![CDATA[<p dir="auto">Hi ;</p>
<p dir="auto">I have multiple hits of number 45371001190000 in the text document so for each hit i want to increase the number by 1 for example for first hit no change to 45371001190000 for 2nd hit it should be updated to 45371001190001 and for the next 45371001190002 and so on .</p>
<p dir="auto">Thanks to advance for the help,</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/18424/find-and-increment-by-1</link><generator>RSS for Node</generator><lastBuildDate>Mon, 12 Oct 2026 08:48:32 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/18424.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 28 Oct 2019 14:17:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Find and increment by 1 on Tue, 29 Oct 2019 11:54:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> said in <a href="/post/48119">Find and increment by 1</a>:</p>
<blockquote>
<p dir="auto">But I just realize that, in case the 45371001190000 number is not on consecutive lines</p>
</blockquote>
<p dir="auto">I’m glad you realized that…</p>
<h2>:-)</h2>
]]></description><link>https://community.notepad-plus-plus.org/post/48121</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48121</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 29 Oct 2019 11:54:10 GMT</pubDate></item><item><title><![CDATA[Reply to Find and increment by 1 on Tue, 29 Oct 2019 09:09:22 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/saima-rafiq" aria-label="Profile: saima-rafiq">@<bdi>saima-rafiq</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-kilborn">@<bdi>Alan-kilborn</bdi></a> and All,</p>
<p dir="auto">Of course this short <strong><code>Python</code></strong> script is <strong>ridiculously</strong> easy to understand ;-))</p>
<p dir="auto">With <strong>regular</strong> expressions, it’s a little <strong>longer</strong> but still doable !</p>
<hr />
<p dir="auto">For instance, given the <strong>sample</strong> text :</p>
<pre><code class="language-diff">The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
The number 45371001190000 is increasing...
</code></pre>
<ul>
<li>
<p dir="auto">With this fist <strong>regex</strong> S/R, we add the <strong>left</strong> part of the number, at <strong>beginning</strong> of lines, followed with a <strong>space</strong> character :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>^</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>4537100\x20</code></strong></p>
</li>
</ul>
</li>
</ul>
<p dir="auto">giving :</p>
<pre><code class="language-diff">4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
4537100 The number 45371001190000 is increasing...
</code></pre>
<ul>
<li>
<p dir="auto">Now, place the <strong>caret</strong>, on the <strong><code>1st</code></strong> line, <strong>right after</strong> the number <strong><code>4537100</code></strong></p>
</li>
<li>
<p dir="auto">Select the option <strong><code>Edit &gt; Column Editor...</code></strong> ( <strong><code>Alt + C</code></strong> )</p>
</li>
<li>
<p dir="auto">Choose the option <strong><code>Number to Insert</code></strong></p>
</li>
<li>
<p dir="auto">Type in <strong><code>1190000</code></strong> in field <strong><code>Initial number</code></strong></p>
</li>
<li>
<p dir="auto">Type in <strong><code>1</code></strong>  in field <strong><code>Increase by</code></strong></p>
</li>
<li>
<p dir="auto">Type in <strong><code>1</code></strong>  in field <strong><code>Repeat</code></strong></p>
</li>
<li>
<p dir="auto">Select, if necessary, the <strong><code>Dec</code></strong> format</p>
</li>
<li>
<p dir="auto">Click on the <strong><code>OK</code></strong> button</p>
</li>
</ul>
<p dir="auto">We get :</p>
<pre><code class="language-diff">45371001190000 The number 45371001190000 is increasing...
45371001190001 The number 45371001190000 is increasing...
45371001190002 The number 45371001190000 is increasing...
45371001190003 The number 45371001190000 is increasing...
45371001190004 The number 45371001190000 is increasing...
45371001190005 The number 45371001190000 is increasing...
45371001190006 The number 45371001190000 is increasing...
45371001190007 The number 45371001190000 is increasing...
45371001190008 The number 45371001190000 is increasing...
45371001190009 The number 45371001190000 is increasing...
45371001190010 The number 45371001190000 is increasing...
45371001190011 The number 45371001190000 is increasing...
45371001190012 The number 45371001190000 is increasing...
45371001190013 The number 45371001190000 is increasing...
45371001190014 The number 45371001190000 is increasing...
45371001190015 The number 45371001190000 is increasing...
45371001190016 The number 45371001190000 is increasing...
45371001190017 The number 45371001190000 is increasing...
45371001190018 The number 45371001190000 is increasing...
45371001190019 The number 45371001190000 is increasing...
</code></pre>
<ul>
<li>
<p dir="auto">Finally, the regex S/R, below, <strong>overwrites</strong> the <strong><code>45371001190000</code></strong> number with the <strong>increasing</strong> number, at <strong>present start</strong> of lines</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?-s)^(\d+)(.+?)45371001190000</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>\2\1</code></strong></p>
</li>
</ul>
</li>
</ul>
<pre><code class="language-diff"> The number 45371001190000 is increasing...
 The number 45371001190001 is increasing...
 The number 45371001190002 is increasing...
 The number 45371001190003 is increasing...
 The number 45371001190004 is increasing...
 The number 45371001190005 is increasing...
 The number 45371001190006 is increasing...
 The number 45371001190007 is increasing...
 The number 45371001190008 is increasing...
 The number 45371001190009 is increasing...
 The number 45371001190010 is increasing...
 The number 45371001190011 is increasing...
 The number 45371001190012 is increasing...
 The number 45371001190013 is increasing...
 The number 45371001190014 is increasing...
 The number 45371001190015 is increasing...
 The number 45371001190016 is increasing...
 The number 45371001190017 is increasing...
 The number 45371001190018 is increasing...
 The number 45371001190019 is increasing...
</code></pre>
<p dir="auto">Of course, just an exercise…, ah ah !</p>
<hr />
<p dir="auto">But I just realize that, in case the <strong><code>45371001190000</code></strong> number is <strong>not</strong> on <strong>consecutive</strong> lines, the <strong>Column Editor</strong> method does <strong>not</strong> work. Indeed, the <strong>script</strong> method is the <strong>definitive</strong> one ;-))</p>
<p dir="auto">Best Regards</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48119</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48119</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 29 Oct 2019 09:09:22 GMT</pubDate></item><item><title><![CDATA[Reply to Find and increment by 1 on Mon, 28 Oct 2019 14:52:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/saima-rafiq" aria-label="Profile: Saima-Rafiq">@<bdi>Saima-Rafiq</bdi></a></p>
<p dir="auto">Sure.  There’s already a great example for Pythonscript that is <em>close</em> to what you want to do:</p>
<p dir="auto">In the help file for <code>editor.rereplace</code>:</p>
<pre><code>def add_1(m):
    return 'Y' + str(number(m.group(1)) + 1)

# replace X followed by numbers by an incremented number
# e.g.   X56 X39 X999
#          becomes
#        Y57 Y40 Y1000

editor.rereplace('X([0-9]+)', add_1);```</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/48110</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48110</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 28 Oct 2019 14:52:55 GMT</pubDate></item><item><title><![CDATA[Reply to Find and increment by 1 on Mon, 28 Oct 2019 14:49:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> I can add the script plugin to Notepad++ , can you help with the script which can get me the desire result ?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48109</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48109</guid><dc:creator><![CDATA[Saima Rafiq]]></dc:creator><pubDate>Mon, 28 Oct 2019 14:49:34 GMT</pubDate></item><item><title><![CDATA[Reply to Find and increment by 1 on Mon, 28 Oct 2019 14:47:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/saima-rafiq" aria-label="Profile: Saima-Rafiq">@<bdi>Saima-Rafiq</bdi></a></p>
<p dir="auto">You need a programming language to help with this, I’m afraid.  You could certainly use a scripting plugin for Notepad++ as that programming language…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48108</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48108</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 28 Oct 2019 14:47:52 GMT</pubDate></item></channel></rss>