<?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[Adding multiple lines to the bottom of documents]]></title><description><![CDATA[<p dir="auto">Hi All,</p>
<p dir="auto">I have been left ‘in the lurch’ by a wayward developer who was updating a site of mine. I have nearly got things straight and working but have a problem on one batch of over 5000 html/php files. I have multiple lines to move in every one. I know how to select multiple lines in multiple files and delete them but I cannot find out how to select a sinle line (in this case the bottom statement &lt;/body&gt;&lt;/html&gt;) and replace this with multiple lines (including of course finishing with &lt;/body&gt;&lt;/html&gt;).</p>
<p dir="auto">Can anyone help?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/17667/adding-multiple-lines-to-the-bottom-of-documents</link><generator>RSS for Node</generator><lastBuildDate>Sat, 15 Aug 2026 11:08:39 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/17667.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 19 May 2019 14:58:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Adding multiple lines to the bottom of documents on Mon, 20 May 2019 00:55:45 GMT]]></title><description><![CDATA[<p dir="auto">Hi Guy,</p>
<p dir="auto">I found time to have a go - and totally screwed it up! On a few test files only thank goodness. Second attempt worked perfectly. I have since applied the solution to all my php files and uploaded them and, yers they do work.<br />
<a href="https://www.minibottlelibrary.com/mbl/index.html" rel="nofollow ugc">https://www.minibottlelibrary.com/mbl/index.html</a> (straights area)</p>
<p dir="auto">Again, MANY THANKS.</p>
<p dir="auto">David</p>
]]></description><link>https://community.notepad-plus-plus.org/post/43615</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/43615</guid><dc:creator><![CDATA[David Smith179]]></dc:creator><pubDate>Mon, 20 May 2019 00:55:45 GMT</pubDate></item><item><title><![CDATA[Reply to Adding multiple lines to the bottom of documents on Sun, 19 May 2019 21:17:58 GMT]]></title><description><![CDATA[<p dir="auto">Hi Guy,</p>
<p dir="auto">Thanks - that’s all double dutch to me!</p>
<p dir="auto">However, I can usually work these things out.</p>
<p dir="auto">I am tied up at present so will not be able to tell you whether I succeded or not until tomorrow.</p>
<p dir="auto">Many Thanks</p>
<p dir="auto">David</p>
]]></description><link>https://community.notepad-plus-plus.org/post/43613</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/43613</guid><dc:creator><![CDATA[David Smith179]]></dc:creator><pubDate>Sun, 19 May 2019 21:17:58 GMT</pubDate></item><item><title><![CDATA[Reply to Adding multiple lines to the bottom of documents on Sun, 19 May 2019 21:02:59 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/david-smith179" aria-label="Profile: david-smith179">@<bdi>david-smith179</bdi></a>, and <strong>All</strong>,</p>
<p dir="auto">Perfect ! First, I would like to remind you that the <strong><code>Find what :</code></strong> and <strong><code>Replace with :</code></strong> zones, of the <strong>Replace</strong> dialog, can contain a <strong>maximum</strong> amount of <strong><code>2046</code></strong> characters ! But, unlike the <strong><code>Find what :</code></strong> zone, which may contains a <strong>multi-lines</strong> text, the <strong><code>Replace with :</code></strong> zone can <strong>only</strong> a <strong>single</strong> line, ( from <strong><code>0</code></strong> to <strong><code>2046</code></strong> characters ! )</p>
<p dir="auto">So we need to transform your <strong>7-lines</strong> text to add into a <strong>single</strong> line, which, in addition, must <strong>escape</strong> some <strong>meta</strong>-characters with the <strong><code>\</code></strong> character, in order to obtain a <strong>complete literal single</strong> line. To achieve this :</p>
<ul>
<li>
<p dir="auto">Paste your <strong>7-lines</strong> area in a <strong>new</strong> N++ tab</p>
</li>
<li>
<p dir="auto">Add a <strong>line-break</strong>, right <strong>before</strong> this bunch of lines, hitting the <strong>Enter</strong> key</p>
</li>
<li>
<p dir="auto">In the same way, add a <strong>line-break</strong>, right <strong>after</strong> the <strong>7th</strong> line</p>
</li>
<li>
<p dir="auto">Open the <strong>Replace</strong> dialog ( <strong><code>Ctrl + H</code></strong> )</p>
</li>
<li>
<p dir="auto">SEARCH <strong><code>([{}()\\$?:])|\R</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>(?1\\$1:\\r\\n)</code></strong></p>
</li>
<li>
<p dir="auto">Tick the <strong><code>Wrap around</code></strong> option</p>
</li>
<li>
<p dir="auto">Select the <strong><code>Regular expression</code></strong> search mode</p>
</li>
<li>
<p dir="auto">Click on the <strong><code>Replace All</code></strong> button</p>
</li>
</ul>
<p dir="auto">=&gt; You should obtain the <strong>one-line</strong> text below ( Actually, <strong>not</strong> exactly because of the <strong><code>...</code></strong> zones not described ! ) :</p>
<pre><code class="language-html">\r\n&lt;script src="…/…/script/jquery-1.10.1.min.js"&gt;&lt;/script&gt;\r\n&lt;script type="text/javascript" src="…/…/script/jquery.fancybox.pack.js"&gt;&lt;/script&gt;\r\n&lt;script&gt;\r\n\$\(document\).ready\(function\(\) \{\r\n\$\('.fancybox'\).fancybox\(\);\r\n\}\);\r\n&lt;/script&gt;\r\n
</code></pre>
<hr />
<p dir="auto">Now, here is the <strong>main</strong> regex S/R :</p>
<ul>
<li>
<p dir="auto">Copy this <strong>one-line</strong> text, above,  in the <strong>clipboard</strong></p>
</li>
<li>
<p dir="auto">Switch <strong>back</strong> to your <strong>HTML</strong> file</p>
</li>
<li>
<p dir="auto">If necessary, re-open the <strong>Replace</strong> dialog</p>
</li>
<li>
<p dir="auto">Paste this <strong>one-line</strong> text in the <strong><code>Replacement with :</code></strong> zone</p>
</li>
<li>
<p dir="auto">In the <strong><code>Find what :</code></strong> zone, type in the simple regex <strong><code>(?=&lt;/body&gt;&lt;/html&gt;)</code></strong></p>
</li>
<li>
<p dir="auto">Again, click on the <strong><code>Replace All</code></strong> button</p>
</li>
</ul>
<p dir="auto">So, from your <strong>initial last</strong> line :</p>
<pre><code class="language-html">&lt;script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"&gt;&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;
</code></pre>
<p dir="auto">You should get, as <strong>expected</strong>, the text :</p>
<pre><code class="language-html">&lt;script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;script src="…/…/script/jquery-1.10.1.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="…/…/script/jquery.fancybox.pack.js"&gt;&lt;/script&gt;
&lt;script&gt;
$(document).ready(function() {
$('.fancybox').fancybox();
});
&lt;/script&gt;
&lt;/body&gt;&lt;/html&gt;
</code></pre>
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">The search regex ( <strong><code>(?=&lt;/body&gt;&lt;/html&gt;)</code></strong> ) is a <strong>look-ahead</strong> structure, i.e. a <strong>zero-length</strong> assertion, which looks for the location <strong>right before</strong> the text <strong><code>&lt;/body&gt;&lt;/html&gt;</code></strong></p>
</li>
<li>
<p dir="auto">At this location, all the <strong>one-line</strong> text, <strong>previously</strong> inserted in the <strong>Replacement</strong> zone, is written and any part <strong><code>\r\n</code></strong> is changed into a true <strong>line-break</strong>, in order to reconstitute the <strong>multi-lines</strong> text !</p>
</li>
</ul>
<p dir="auto"><strong>Remarks</strong> :</p>
<ul>
<li>
<p dir="auto">I <strong>strongly</strong> advice you to test this <strong>final</strong> regex S/R on a <strong>single</strong> or <strong>few</strong> HTML file(s), to begins with !</p>
</li>
<li>
<p dir="auto">If everything seems OK, <strong>backup</strong> the folder containing the files to be <strong>modified</strong> ( One nevers knows ! )</p>
</li>
<li>
<p dir="auto">And, of course, use, this time, the <strong><code>Find in Files</code></strong> dialog to perform the <strong>regex</strong> S/R on all your <strong>HTML</strong> files</p>
</li>
</ul>
<p dir="auto">Hope this helps ;-))</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/43612</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/43612</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 19 May 2019 21:02:59 GMT</pubDate></item><item><title><![CDATA[Reply to Adding multiple lines to the bottom of documents on Sun, 19 May 2019 19:26:29 GMT]]></title><description><![CDATA[<p dir="auto">Hi Guy,</p>
<p dir="auto">Yes it looks correct.</p>
<p dir="auto">The …/…/ is the path back to the script directory:</p>
<p dir="auto">mbl\script<br />
mbl\alpha\directory with php file in it</p>
<p dir="auto">If for some reason it looks wrong to you, don’t worry, it works!</p>
<p dir="auto">Thanks<br />
David</p>
]]></description><link>https://community.notepad-plus-plus.org/post/43609</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/43609</guid><dc:creator><![CDATA[David Smith179]]></dc:creator><pubDate>Sun, 19 May 2019 19:26:29 GMT</pubDate></item><item><title><![CDATA[Reply to Adding multiple lines to the bottom of documents on Sun, 19 May 2019 19:16:23 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/david-smith179" aria-label="Profile: david-smith179">@<bdi>david-smith179</bdi></a>, and <strong>All</strong>,</p>
<p dir="auto">First, as you said :</p>
<blockquote>
<p dir="auto">I know how to select multiple lines in multiple files and delete them</p>
</blockquote>
<p dir="auto">I suppose that you’ve <strong>already</strong> get rid of this <strong>7-lines</strong> bunch, near the <strong>beginning</strong> of <strong>all</strong> your files !</p>
<p dir="auto">Now, if I understand you <strong>correctly</strong>, you would like to insert the text below :</p>
<pre><code class="language-html">&lt;script src="…/…/script/jquery-1.10.1.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="…/…/script/jquery.fancybox.pack.js"&gt;&lt;/script&gt;
&lt;script&gt;
$(document).ready(function() {
$('.fancybox').fancybox();
});
&lt;/script&gt;
</code></pre>
<p dir="auto">between <strong><code>&lt;/script&gt;</code></strong> and <strong><code>&lt;/body&gt;&lt;/html&gt;</code></strong>, at the <strong>end</strong> of the line, below :</p>
<pre><code class="language-html">&lt;script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"&gt;&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;
</code></pre>
<p dir="auto">in order to obtain :</p>
<pre><code class="language-html">&lt;script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;script src="…/…/script/jquery-1.10.1.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="…/…/script/jquery.fancybox.pack.js"&gt;&lt;/script&gt;
&lt;script&gt;
$(document).ready(function() {
$('.fancybox').fancybox();
});
&lt;/script&gt;             #
&lt;/body&gt;&lt;/html&gt;        #  or &lt;/script&gt;&lt;/body&gt;&lt;/html&gt;
</code></pre>
<p dir="auto"><strong>Remarks</strong> :</p>
<ul>
<li>
<p dir="auto">I noticed that you used the <strong><code>…</code></strong> character, in lines <strong><code>1</code></strong> and <strong><code>2</code></strong> of your <strong>7-lines</strong> area, which supposes some <strong>hidden</strong> text ! Note that, in order that the future <strong>regex</strong> S/R works correctly, the <strong>total</strong> amount of these <strong>7-lines</strong> bunch, which will be inserted in the <strong>replacement</strong> zone, after a <strong>slight</strong> modification, should <strong>not</strong> exceed <strong><code>2000</code></strong> characters !</p>
</li>
<li>
<p dir="auto">Please, verify if the above <strong>code</strong> zones, with <strong>black</strong> background, seem <strong>correct</strong> !</p>
</li>
</ul>
<p dir="auto">If so, the regex S/R is a question of <strong>minutes</strong> ;-))</p>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/43608</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/43608</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 19 May 2019 19:16:23 GMT</pubDate></item><item><title><![CDATA[Reply to Adding multiple lines to the bottom of documents on Sun, 19 May 2019 18:57:05 GMT]]></title><description><![CDATA[<p dir="auto">Me again Guy,</p>
<p dir="auto">I should add that I am not a programmer. I can do basic (old school!) html.</p>
<p dir="auto">The files are in multiple sub-directories (1 in each) of one directory.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/43607</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/43607</guid><dc:creator><![CDATA[David Smith179]]></dc:creator><pubDate>Sun, 19 May 2019 18:57:05 GMT</pubDate></item><item><title><![CDATA[Reply to Adding multiple lines to the bottom of documents on Sun, 19 May 2019 18:27:25 GMT]]></title><description><![CDATA[<p dir="auto">Hi Guy,</p>
<p dir="auto">I need to add 7 lines before the &lt;/body&gt;&lt;/html&gt; statement. For reasons known only to him my wayward developer moved these lines to near the beginning of the files. The Fancybox script screws up if not at the bottom. An added complication is that &lt;/body&gt;&lt;/html&gt; are currently on the end of a script line:<br />
&lt;script src=“<a href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" rel="nofollow ugc">https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js</a>” integrity=“sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM” crossorigin=“anonymous”&gt;&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;<br />
Just in case it matters these are the 7 lines:<br />
&lt;script src=“…/…/script/jquery-1.10.1.min.js”&gt;&lt;/script&gt;<br />
&lt;script type=“text/javascript” src=“…/…/script/jquery.fancybox.pack.js”&gt;&lt;/script&gt;<br />
&lt;script&gt;<br />
$(document).ready(function() {<br />
$(‘.fancybox’).fancybox();<br />
});<br />
&lt;/script&gt;</p>
<p dir="auto">Thanks for trying to help.<br />
David</p>
]]></description><link>https://community.notepad-plus-plus.org/post/43605</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/43605</guid><dc:creator><![CDATA[David Smith179]]></dc:creator><pubDate>Sun, 19 May 2019 18:27:25 GMT</pubDate></item><item><title><![CDATA[Reply to Adding multiple lines to the bottom of documents on Sun, 19 May 2019 17:41:28 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/david-smith179" aria-label="Profile: david-smith179">@<bdi>david-smith179</bdi></a>,</p>
<p dir="auto">Welcome to the <strong>N++ Community</strong> !</p>
<p dir="auto">So, assuming a bunch of <strong>html/php</strong> files, in a <strong>single</strong> directory :</p>
<ul>
<li>
<p dir="auto">Is the <strong>multi_lines</strong> area to add, <strong>right before</strong> the <strong><code>&lt;/body&gt;&lt;/html&gt;</code></strong> at <strong>end</strong> of files, be always the <strong>same</strong> ?</p>
</li>
<li>
<p dir="auto">Roughly, what would be the <strong>maximum</strong> size of your <strong>multi-lines</strong> area to insert ?</p>
</li>
</ul>
<p dir="auto">If this area is <strong>not too</strong> large, I suppose that this could be simply achieve with a <strong>regex</strong> S/R !</p>
<p dir="auto">See you later,</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/43601</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/43601</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 19 May 2019 17:41:28 GMT</pubDate></item></channel></rss>