<?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[Advanced replace]]></title><description><![CDATA[<p dir="auto">Hello</p>
<p dir="auto">I need help finding and replacing values ​​in a given situation</p>
<p dir="auto">I have a .xml file and I need to find all the numbers inside this " &lt;ClosingStockQuantity&gt;0.5&lt;/ClosingStockQuantity&gt; " and add + 0 to keep all values ​​that have one decimal place with two decimal places.</p>
<p dir="auto">Thank you</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/26586/advanced-replace</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Sep 2026 04:58:15 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/26586.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 27 Jan 2025 12:09:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Advanced replace on Mon, 27 Jan 2025 15:46:55 GMT]]></title><description><![CDATA[<p dir="auto">@Américo-J-C-Sousa<br />
Try using the find-replace form (<code>Search-&gt;Replace</code> from the main menu or Ctrl+H with default keybindings) and do the following:</p>
<ul>
<li>Set <code>Search Mode</code> to <strong>Regular Expressions</strong></li>
<li>Check the <strong>Wrap around</strong> box</li>
<li><strong>Find what:</strong> <code>&lt;(ClosingStockQuantity&gt;)(-?\d+)(\.\d)?&lt;/ClosingStockQuantity&gt;</code></li>
<li><strong>Replace with:</strong> <code>&lt;${1}${2}(?3${3}0:.00)&lt;/${1}</code></li>
</ul>
<p dir="auto">This will add a zero as the second decimal place for all numbers that already have one decimal place, and a <code>.00</code> after all numbers that don’t yet have any decimal places.</p>
<p dir="auto">Note that this is just manipulating the numbers as text, not doing actual math. If you wanted to do math on the numbers, you will need to use a scripting language.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/99396</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/99396</guid><dc:creator><![CDATA[Mark Olson]]></dc:creator><pubDate>Mon, 27 Jan 2025 15:46:55 GMT</pubDate></item><item><title><![CDATA[Reply to Advanced replace on Mon, 27 Jan 2025 15:23:56 GMT]]></title><description><![CDATA[<p dir="auto">Hello, @américo-j-c-sousa, and <strong>All</strong>,</p>
<p dir="auto">Easy with <strong>regular</strong> expressions !</p>
<hr />
<ul>
<li>
<p dir="auto">Open your file in <strong>N++</strong></p>
</li>
<li>
<p dir="auto">Open the <strong>Replace</strong> dialog ( <strong><code>Ctrl + H</code></strong> )</p>
</li>
<li>
<p dir="auto"><strong>Untick</strong> all <strong>box</strong> options</p>
</li>
<li>
<p dir="auto">FIND <strong><code>&lt;(ClosingStockQuantity)&gt;(\d+\.\d)&lt;/ClosingStockQuantity&gt;</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>&lt;$1&gt;${2}0&lt;/$1&gt;</code></strong></p>
</li>
<li>
<p dir="auto">Check the <strong><code>Wrap around</code></strong> option</p>
</li>
<li>
<p dir="auto">Select the <strong><code>Regular expression</code></strong> search <strong>mode</strong></p>
</li>
<li>
<p dir="auto">Click, <strong>once</strong> only, on the <strong><code>Replace All</code></strong> button or <strong>several</strong> times on the <strong><code>Replace</code></strong> button</p>
</li>
</ul>
<p dir="auto">Voila !</p>
<hr />
<p dir="auto">Thus, for this kind of <em>INPUT</em> text :</p>
<pre><code class="language-diff">&lt;ClosingStockQuantity&gt;0.5&lt;/ClosingStockQuantity&gt;
&lt;ClosingStockQuantity&gt;0.33&lt;/ClosingStockQuantity&gt;
&lt;ClosingStockQuantity&gt;0.1&lt;/ClosingStockQuantity&gt;
&lt;ClosingStockQuantity&gt;1&lt;/ClosingStockQuantity&gt;
&lt;ClosingStockQuantity&gt;4.7&lt;/ClosingStockQuantity&gt;
&lt;ClosingStockQuantity&gt;97.2&lt;/ClosingStockQuantity&gt;
&lt;ClosingStockQuantity&gt;123&lt;/ClosingStockQuantity&gt;
</code></pre>
<p dir="auto">You should get your <strong>expected</strong> <em>OUTPUT</em>, below :</p>
<pre><code class="language-diff">&lt;ClosingStockQuantity&gt;0.50&lt;/ClosingStockQuantity&gt;
&lt;ClosingStockQuantity&gt;0.33&lt;/ClosingStockQuantity&gt;
&lt;ClosingStockQuantity&gt;0.10&lt;/ClosingStockQuantity&gt;
&lt;ClosingStockQuantity&gt;1&lt;/ClosingStockQuantity&gt;
&lt;ClosingStockQuantity&gt;4.70&lt;/ClosingStockQuantity&gt;
&lt;ClosingStockQuantity&gt;97.20&lt;/ClosingStockQuantity&gt;
&lt;ClosingStockQuantity&gt;123&lt;/ClosingStockQuantity&gt;
</code></pre>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/99394</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/99394</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Mon, 27 Jan 2025 15:23:56 GMT</pubDate></item></channel></rss>