<?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[&quot;Remove Unnecessary Blank and EOL&quot; ?]]></title><description><![CDATA[<p dir="auto">I’ve been trying to pin down what the <em>Remove Unnecessary Blank and EOL</em> menu item does, exactly.  It seems like this is close, but not quite:</p>
<p dir="auto">Find <code>(\h*\R)+</code><br />
Replace with single space<br />
Wrap around on<br />
(regex mode of course)</p>
<p dir="auto">Anybody know EXACTLY what this command does?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/17609/remove-unnecessary-blank-and-eol</link><generator>RSS for Node</generator><lastBuildDate>Sat, 13 Jun 2026 21:26:43 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/17609.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 11 May 2019 12:34:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to &quot;Remove Unnecessary Blank and EOL&quot; ? on Tue, 27 Dec 2022 02:47:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/donho" aria-label="Profile: donho">@<bdi>donho</bdi></a> said in <a href="/post/82769">“Remove Unnecessary Blank and EOL” ?</a>:</p>
<blockquote>
<p dir="auto">I agree it’s named very badly. Do we have a better naming? Any suggestion?</p>
</blockquote>
<p dir="auto">Not a great one.  But see <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12702#issuecomment-1365549359" rel="nofollow ugc">HERE</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82773</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82773</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 27 Dec 2022 02:47:50 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Remove Unnecessary Blank and EOL&quot; ? on Mon, 26 Dec 2022 20:59:10 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> said in <a href="/post/43238">“Remove Unnecessary Blank and EOL” ?</a>:</p>
<blockquote>
<p dir="auto">I have one final question, and this one is for <a class="plugin-mentions-user plugin-mentions-a" href="/user/donho" aria-label="Profile: donho">@<bdi>donho</bdi></a> (and of course will never be answered, and really is rhetorical anyway), and this is: What gives you the right to decree that these things are “unnecessary”?</p>
</blockquote>
<p dir="auto">Oups sorry, I just saw your question (by googling “Remove Unnecessary Blank and EOL”).</p>
<p dir="auto"><a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12702#issuecomment-1365146588" rel="nofollow ugc">As I mentioned</a>, I agree it’s named very badly. Do we have a better naming? Any suggestion?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82769</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82769</guid><dc:creator><![CDATA[donho]]></dc:creator><pubDate>Mon, 26 Dec 2022 20:59:10 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Remove Unnecessary Blank and EOL&quot; ? on Sun, 12 May 2019 00:13:52 GMT]]></title><description><![CDATA[<p dir="auto">So, thanks everyone for contributing.  I think it has now officially been beaten to death.  I’ll mark as SOLVED now…</p>
<p dir="auto">But…</p>
<p dir="auto">I have one final question, and this one is for <a class="plugin-mentions-user plugin-mentions-a" href="/user/donho" aria-label="Profile: donho">@<bdi>donho</bdi></a> (and of course will never be answered, and really is rhetorical anyway), and this is:  <em>What gives you the right to decree that these things are “unnecessary”?</em></p>
<h2>:)</h2>
]]></description><link>https://community.notepad-plus-plus.org/post/43238</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/43238</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sun, 12 May 2019 00:13:52 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Remove Unnecessary Blank and EOL&quot; ? on Sun, 12 May 2019 10:14:57 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/meta-chuh" aria-label="Profile: meta-chuh">@<bdi>meta-chuh</bdi></a>, and <strong>All</strong>,</p>
<p dir="auto"><strong>UPDATED</strong> on <strong>05 12 2019</strong> : I made the regex, below, more <strong>accurate</strong> as I changed the <strong><code>\h</code></strong> syntax by the more <strong>strict</strong> one  <strong><code>[\t\x20]</code></strong></p>
<p dir="auto">When run <strong>consecutively</strong>, my <strong>two</strong> previous regexes  do <strong>simulate</strong> the <strong><code>Remove Unnecessary Blank and EOL</code></strong> option !</p>
<p dir="auto">Of course, <strong>Alan</strong>, my <strong>initial</strong> goal was to find an <strong>unique</strong> regex S/R !  So, I thought again about this problem and, after <strong>additional</strong> tests, I finally found out a solution :</p>
<p dir="auto">SEARCH  <strong><code>[\t\x20]*\R[\t\x20]*</code></strong></p>
<p dir="auto">REPLACE <strong><code>\x20</code></strong></p>
<p dir="auto">Thus, from the <strong>search</strong> regex, it’s easy to transpose it in <strong>natural</strong> speech :</p>
<p dir="auto">The <strong><code>Remove Unnecessary Blank and EOL</code></strong> option <strong>replaces</strong> any kind of <strong>line-break</strong>, <strong>possibly</strong> surrounded by, either, <strong><code>tabulation</code></strong> and/or <strong><code>space</code></strong> character(s), with a <strong>single</strong> <strong><code>space</code></strong> character ;-))</p>
<hr />
<p dir="auto">Indeed, <strong>Alan</strong>, it’s valuable to remember that <strong>multiple</strong> regex S/R can be <strong>recorded</strong>, one after another, in a <strong>single</strong> macro ! It’s just that, most of the time, I simply <strong>re-invent</strong> the <strong>regular</strong> expression(s), necessary for my <strong>current</strong> work, if the <strong>overall</strong> regex(es) is/are <strong>not</strong> so complicated, of course ;-))</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/43234</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/43234</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 12 May 2019 10:14:57 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Remove Unnecessary Blank and EOL&quot; ? on Sat, 11 May 2019 19:04:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/meta-chuh" aria-label="Profile: Meta-Chuh">@<bdi>Meta-Chuh</bdi></a> said:</p>
<blockquote>
<p dir="auto">please keep me informed for who you intended this info to be for</p>
</blockquote>
<p dir="auto">Hmmm, well it started out one way (<em>Remove Unnecessary…</em>) and then went almost a totally different way (a maybe enlightening technique for making multiple replacement operations appear like one action via macro record).  Two really different things.  That’s all.</p>
<p dir="auto">Often posters here (myself included I guess) bend over backwards trying to help someone with a complicated regex replacement that might be made much simpler with a multistep replacement.  Because macros can be named, and simple replacements can’t (unlike with other text editors) but can be when they are recorded in a macro, I’m going to think better of and make more use of this kind of thing in the future.  Maybe not revolutionary, but I for one haven’t been thinking this way in the (distant) past.  It’s been more of a recent-past fetish (wrong word but can’t think of better ATM!) of mine.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/43233</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/43233</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 11 May 2019 19:04:01 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Remove Unnecessary Blank and EOL&quot; ? on Sat, 11 May 2019 16:26:00 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></p>
<blockquote>
<p dir="auto">… and other readers might not know that you can do this.</p>
</blockquote>
<p dir="auto">after this sentence part, i’m not sure anymore if, by asking the question:</p>
<blockquote>
<p dir="auto">Anybody know EXACTLY what this command does?</p>
</blockquote>
<p dir="auto">you wanted to know, what the command does programmatically for yourself, or if you wanted to know what it does at all, from a user perspective.</p>
<p dir="auto">for you, i guess the answer was suitable, but for normal users, the answer would be rather explaining what it does:</p>
<p dir="auto"><code>Remove Unnecessary Blank and EOL</code> removes all indentation, empty lines, and merges the whole file into one single line.</p>
<p dir="auto">(not quite accurate, but probably being the more understandable explanation, than to say: it removes all leading/trailing white spaces and line feeds of every line of a document)</p>
<p dir="auto">please keep me informed for who you intended this info to be for, as i am confused … again ;-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/43225</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/43225</guid><dc:creator><![CDATA[Meta Chuh]]></dc:creator><pubDate>Sat, 11 May 2019 16:26:00 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Remove Unnecessary Blank and EOL&quot; ? on Sat, 11 May 2019 16:03:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/meta-chuh" aria-label="Profile: Meta-Chuh">@<bdi>Meta-Chuh</bdi></a> and <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a></p>
<p dir="auto">Thanks for your inputs!</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> said:</p>
<blockquote>
<p dir="auto">The two S/R cannot be run simultaneously !</p>
</blockquote>
<p dir="auto">Well, say one wanted to recreate the <em>Remove Unnecessary…</em> functionality in a single regex operation.  One could simply record a macro with <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> 's two replacement operations…then when the user runs a <em>single</em> operation (the macro), <em>two</em> operations are done.</p>
<p dir="auto">I’m pointing this out because I often combine multiple regex replacement operations into a macro so that it appears to be a single simple operation, and other readers might not know that you can do this.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/43223</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/43223</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 11 May 2019 16:03:47 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Remove Unnecessary Blank and EOL&quot; ? on Sat, 11 May 2019 14:24:36 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/meta-chuh" aria-label="Profile: meta-chuh">@<bdi>meta-chuh</bdi></a>, and <strong>All</strong>,</p>
<p dir="auto">After some <strong>tests</strong>, I deduced that the <strong><code>Edit &gt; Blank Operations &gt; Remove Unnecessary Blank and EOL</code></strong> operation is <strong>equivalent</strong> to the <strong>two</strong> regex S/R, below, run <strong>consecutively</strong> !</p>
<ul>
<li>
<p dir="auto">First, all <strong>leading</strong> and <strong>trailing</strong> <strong><code>tabulation</code></strong> and/or <strong><code>space</code></strong> character(s) are <strong>deleted</strong>, with the regex :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>^[\t\x20]+|[\t\x20]+$</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>Leave EMPTY</code></strong></p>
</li>
</ul>
</li>
<li>
<p dir="auto">Secondly, any <strong><code>line-break</code></strong> ( <strong>Windows</strong>, <strong>Unix</strong>, or <strong>Mac</strong> ) is changed into a <strong>single</strong> <strong><code>space</code></strong> character, with the regex :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>\R</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>\x20</code></strong></p>
</li>
</ul>
</li>
</ul>
<hr />
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">This <strong>option</strong> and the <strong>regexes</strong> preserve the <strong>space</strong> and/or <strong>tabulation</strong> characters, when located between <strong>words</strong> or <strong>strings</strong></p>
</li>
<li>
<p dir="auto">The two S/R <strong>cannot</strong> be run <strong>simultaneously</strong> ! Indeed, if the <strong>previous</strong> match was, for instance, a <strong>line-break</strong> ( <strong><code>\R</code></strong> ), so changed into <strong>space</strong>,  then  a  <strong><code>^[\t\x20]+</code></strong> match <strong>cannot</strong> occur anymore as the assertion <strong><code>^</code></strong> <strong>cannot</strong> be found :-((</p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/43222</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/43222</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sat, 11 May 2019 14:24:36 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Remove Unnecessary Blank and EOL&quot; ? on Sat, 11 May 2019 14:24:56 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></p>
<p dir="auto">the menu item “Remove Unnecessary Blank and EOL” has id <code>IDM_EDIT_TRIMALL</code> (see <code>Notepad_plus.rc</code>)</p>
<p dir="auto">from <code>NppCommands.cpp</code> it calls <code>doTrim(lineTail);</code> and <code>doTrim(lineHeader);</code> as two passes (see <code>Notepad_plus.cpp</code>)</p>
<p dir="auto"><code>doTrim(lineHeader);</code> search string:</p>
<pre><code>env._str2Search = TEXT("^[	 ]+");
</code></pre>
<p dir="auto"><code>doTrim(lineTail);</code> search string:</p>
<pre><code>env._str2Search = TEXT("[	 ]+$");
</code></pre>
<p dir="auto">replace string for both:</p>
<pre><code>env._str4Replace = TEXT("");
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/43217</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/43217</guid><dc:creator><![CDATA[Meta Chuh]]></dc:creator><pubDate>Sat, 11 May 2019 14:24:56 GMT</pubDate></item></channel></rss>