<?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[Stop Macro when find fails]]></title><description><![CDATA[<p dir="auto">This was asked under General topics, but no response.<br />
I have a simple Macro that finds a term and deleted the line containing that term.<br />
But, after the last instance of that term was found, the Macro then proceeds to delete the remaining lines until it reaches the end of the file.</p>
<p dir="auto">How to stop the Macro when it no longer can find the search term?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/23623/stop-macro-when-find-fails</link><generator>RSS for Node</generator><lastBuildDate>Tue, 12 May 2026 03:20:11 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/23623.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 Oct 2022 13:17:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Stop Macro when find fails on Tue, 18 Oct 2022 14:36:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vance-neff" aria-label="Profile: Vance-Neff">@<bdi>Vance-Neff</bdi></a> I’ve also had some surprising behavior when deleting or moving lines in macros.</p>
<p dir="auto">I suggest you abandon this approach, and instead, use a regex F&amp;R to match a complete line containing the term, something like:</p>
<p dir="auto"><code>^.*?YOUR_TERM.*?$</code></p>
<p dir="auto">and then, make sure the <em>Replace with</em> field is properly empty (no spaces).</p>
<p dir="auto">Use <em>Replace</em> a few times to satisfy yourself replacements are being done as expected, then <em>Replace All</em> to act on the whole file.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/80656</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/80656</guid><dc:creator><![CDATA[Neil Schipper]]></dc:creator><pubDate>Tue, 18 Oct 2022 14:36:20 GMT</pubDate></item></channel></rss>