<?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[Delete the line number 15 in multiple files]]></title><description><![CDATA[<p dir="auto"><img src="/assets/uploads/files/1641504791649-6071cf3c-96a0-4652-920e-c445f89c24e3-image.png" alt="6071cf3c-96a0-4652-920e-c445f89c24e3-image.png" class=" img-fluid img-markdown" /><br />
i tried replacing it, but i have other similar lines in same file,<br />
so is there a way to delete/replace exactly the line number 15.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/22348/delete-the-line-number-15-in-multiple-files</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Apr 2026 02:31:36 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/22348.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 06 Jan 2022 21:35:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Delete the line number 15 in multiple files on Sat, 20 Aug 2022 21:39:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/26117">@ADEYINKA-ADEWOYIN</a> ,</p>
<p dir="auto">You do realize that <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a> already answered that question for you: the regex he showed worked for him.  If it doesn’t work for you, you will have to provide more details , because that regex will work to delete the first line of the files.  He even asked you to provide more details to explain how the given regex doesn’t work for you.</p>
<p dir="auto">You really need to read <a href="https://community.notepad-plus-plus.org/topic/22022/faq-desk-template-for-search-replace-questions">this FAQ</a> and see the referenes below.</p>
<p dir="auto">That said, can be simplified: a large part of the original expression was only needed because the original post wanted to delete line#15, not line#1.  To delete the first line is simpler: FIND = <code>(?-s)\A(^.*$\R?)</code>, REPLACE is empty, and SEARCH MODE must be REGULAR EXPRESSION.</p>
<p dir="auto">----</p>
<h3>Useful References</h3>
<ul>
<li><a href="https://community.notepad-plus-plus.org/topic/21965/please-read-before-posting">Please Read Before Posting</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/22022/template-for-search-replace-questions">Template for Search/Replace Questions</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regular-expressions-regex-documentation">FAQ: Where to find regular expressions (regex) documentation</a></li>
<li><a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">Notepad++ Online User Manual: Searching/Regex</a></li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/79251</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/79251</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 20 Aug 2022 21:39:11 GMT</pubDate></item><item><title><![CDATA[Reply to Delete the line number 15 in multiple files on Sat, 20 Aug 2022 19:22:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a> How can I delete line number 1 in multiple files?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/79249</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/79249</guid><dc:creator><![CDATA[ADEYINKA ADEWOYIN]]></dc:creator><pubDate>Sat, 20 Aug 2022 19:22:55 GMT</pubDate></item><item><title><![CDATA[Reply to Delete the line number 15 in multiple files on Sat, 20 Aug 2022 11:11:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/26117">@ADEYINKA-ADEWOYIN</a> said in <a href="/post/79238">Delete the line number 15 in multiple files</a>:</p>
<blockquote>
<p dir="auto">I used (?-s)\A(^.$\R?){14}\K(^.$\R?) to delete line number 1 in multiple files by changing ‘14’ in it to ‘0’ but seems not to work.</p>
</blockquote>
<p dir="auto">I think you mean you tried:</p>
<p dir="auto"><code>(?-s)\A(^.*$\R?){0}\K(^.*$\R?)</code></p>
<p dir="auto">[BTW, it is better to say exactly what you tried, instead of “I used this but I changed…”.  It just helps maximize understanding.]</p>
<p dir="auto">And while that is a bit of overkill for hitting the first line of a file, in my experiments I found it worked just fine.</p>
<p dir="auto">Maybe discuss more exactly what you’re doing to achieve the failed result?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/79239</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/79239</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 20 Aug 2022 11:11:01 GMT</pubDate></item><item><title><![CDATA[Reply to Delete the line number 15 in multiple files on Sat, 20 Aug 2022 08:04:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@PeterJones</a> Thanks for the solution, however, I used (?-s)\A(^.<em>$\R?){14}\K(^.</em>$\R?) to delete line number 1 in multiple files by changing ‘14’ in it to ‘0’ but seems not to work. Can you please help out?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/79238</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/79238</guid><dc:creator><![CDATA[ADEYINKA ADEWOYIN]]></dc:creator><pubDate>Sat, 20 Aug 2022 08:04:46 GMT</pubDate></item><item><title><![CDATA[Reply to Delete the line number 15 in multiple files on Thu, 13 Jan 2022 17:59:37 GMT]]></title><description><![CDATA[<p dir="auto">For future readers: the solution proposed by <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7753">@robin-cruise</a> does <em>not</em> do the same thing as my solution.  So depending on your definition of “delete the line number 15”, that “alternate” solution will fail.</p>
<p dir="auto">Given the data</p>
<pre><code>one
two
three
four
five
six
seven
eight
nine
ten
eleven
twelve
thirteen
fourteen
fifteen
sixteen
</code></pre>
<p dir="auto">the “alternate” solution <code>\A(?:^.*$\R){14}\K.*$</code> will do one of two things: if you have <code>. matches newline</code> enabled, it will match the zero-width match at the very end of the file, deleting nothing, which is obviously not what is desired, by any interpretation of “delete line number 15”.  If you have <code>. matches newline</code> unchecked, it will delete the <em>contents</em> of line 15, but still leave the newline:</p>
<pre><code>one
two
three
four
five
six
seven
eight
nine
ten
eleven
twelve
thirteen
fourteen

sixteen
</code></pre>
<p dir="auto">… with a gap (blank line) between fourteen and sixteen.  This may not be what is desired.</p>
<p dir="auto">On the other hand, my expression <code>(?-s)\A(^.*$\R?){14}\K(^.*$\R?)</code> will delete the whole line, including the newline sequence, regardless of the <code>, matches newline</code> setting.</p>
<pre><code>one
two
three
four
five
six
seven
eight
nine
ten
eleven
twelve
thirteen
fourteen
sixteen
</code></pre>
<p dir="auto">This leaves no blank line between <code>fourteen</code> and <code>sixteen</code>.</p>
<p dir="auto">Since the OP has already said that my solution did exactly what was desired for this question, having someone else providing an answer which results in anything different from the desired results is <em>not</em> presenting an alternative solution, it is presenting an incorrect “solution”, at least for this question.  It may be useful to someone who does want to leave the blank line in line 15. but it’s not what the OP wanted.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72943</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72943</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 13 Jan 2022 17:59:37 GMT</pubDate></item><item><title><![CDATA[Reply to Delete the line number 15 in multiple files on Thu, 13 Jan 2022 16:19:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7753">@robin-cruise</a> said in <a href="/post/72936">Delete the line number 15 in multiple files</a>:</p>
<blockquote>
<p dir="auto">believe that any alternative should be encouraged</p>
</blockquote>
<p dir="auto">Right, especially if it slows down processing.  OMG.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72937</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72937</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 13 Jan 2022 16:19:31 GMT</pubDate></item><item><title><![CDATA[Reply to Delete the line number 15 in multiple files on Thu, 13 Jan 2022 16:07:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@alan-kilborn</a></p>
<blockquote>
<p dir="auto">So I’d suggest not answering a solved issue a week later with just something shorter.</p>
</blockquote>
<p dir="auto">as if to tell a car manufacturer not to produce small cars anymore, because it already has big cars …</p>
<p dir="auto">I believe that any alternative should be encouraged</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72936</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72936</guid><dc:creator><![CDATA[Robin Cruise]]></dc:creator><pubDate>Thu, 13 Jan 2022 16:07:51 GMT</pubDate></item><item><title><![CDATA[Reply to Delete the line number 15 in multiple files on Thu, 13 Jan 2022 13:59:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7753">@robin-cruise</a> said in <a href="/post/72931">Delete the line number 15 in multiple files</a>:</p>
<blockquote>
<p dir="auto">except my regex is shorter</p>
</blockquote>
<p dir="auto">Shorter regexes aren’t always better.<br />
In fact, the regex engine has to work harder to find a match with your version.<br />
So I’d suggest not answering a solved issue a week later with just something shorter.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72932</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72932</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 13 Jan 2022 13:59:11 GMT</pubDate></item><item><title><![CDATA[Reply to Delete the line number 15 in multiple files on Thu, 13 Jan 2022 13:48:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@alan-kilborn</a></p>
<blockquote>
<p dir="auto">Do you have anything to add to explain why your solution meets the need any better, or why its difference is significant?</p>
</blockquote>
<p dir="auto">Of course is a similar solution, except my regex is shorter. It is an alternative solution.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72931</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72931</guid><dc:creator><![CDATA[Robin Cruise]]></dc:creator><pubDate>Thu, 13 Jan 2022 13:48:57 GMT</pubDate></item><item><title><![CDATA[Reply to Delete the line number 15 in multiple files on Wed, 12 Jan 2022 13:05:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7753">@robin-cruise</a> said in <a href="/post/72892">Delete the line number 15 in multiple files</a>:</p>
<blockquote>
<p dir="auto">“I want to delete just the 15th line in every file, no matter what the contents”<br />
FIND: \A(?:^.<em>$\R){14}\K.</em>$</p>
</blockquote>
<p dir="auto">That’s extremely similar to the <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@PeterJones</a> solution.<br />
Do you have anything to add to explain why your solution meets the need any better, or why its difference is significant?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72894</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72894</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 12 Jan 2022 13:05:51 GMT</pubDate></item><item><title><![CDATA[Reply to Delete the line number 15 in multiple files on Wed, 12 Jan 2022 08:55:50 GMT]]></title><description><![CDATA[<p dir="auto">“I want to delete just the 15th line in every file, no matter what the contents”</p>
<p dir="auto">FIND: <code>\A(?:^.*$\R){14}\K.*$</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/72892</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72892</guid><dc:creator><![CDATA[Robin Cruise]]></dc:creator><pubDate>Wed, 12 Jan 2022 08:55:50 GMT</pubDate></item><item><title><![CDATA[Reply to Delete the line number 15 in multiple files on Fri, 07 Jan 2022 15:48:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/22714">@senpay98k</a> said in <a href="/post/72743">Delete the line number 15 in multiple files</a>:</p>
<blockquote>
<p dir="auto"><img src="/assets/uploads/files/1641504791649-6071cf3c-96a0-4652-920e-c445f89c24e3-image.png" alt="6071cf3c-96a0-4652-920e-c445f89c24e3-image.png" class=" img-fluid img-markdown" /><br />
i tried replacing it, but i have other similar lines in same file,<br />
so is there a way to delete/replace exactly the line number 15.</p>
</blockquote>
<p dir="auto">Does the work exactly as writen, thanks a lot :)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72764</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72764</guid><dc:creator><![CDATA[SENPAY98K]]></dc:creator><pubDate>Fri, 07 Jan 2022 15:48:13 GMT</pubDate></item><item><title><![CDATA[Reply to Delete the line number 15 in multiple files on Thu, 06 Jan 2022 22:03:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/22714">@senpay98k</a> ,</p>
<p dir="auto">If you are saying, “I want to delete every line in all these files that contains start-of-line, 4 spaces, the digit two, and a comma, then end of line”, that’s easy: FIND = <code>^\x20{4}2,\R</code> (<em>there were 4 spaces between the ^ and the 2, but the forum collapsed them, so I edited the post to use the regex-equivalent <code>\x20{4}</code></em>), REPLACE = (make this box empty), SEARCH MODE = Regular Expression</p>
<p dir="auto">If you are saying, “I want to grab the contents of line 15 in my first file, then delete that line, and any line that matches that same text in any of the other files”: that cannot be done with find-in-files.  The regex engine doesn’t have any “memory” across files, so it cannot know what line 15 looked like from the first file.</p>
<p dir="auto">If you are saying, “I want to delete just the 15th line in every file, no matter what the contents”, then that’s doable: FIND = <code>(?-s)\A(^.*$\R?){14}\K(^.*$\R?)</code>, REPLACE = (make this box empty), SEARCH MODE = Regular Expression.</p>
<p dir="auto">----</p>
<h3>Useful References</h3>
<ul>
<li><a href="https://community.notepad-plus-plus.org/topic/21965/please-read-before-posting">Please Read Before Posting</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/22022/template-for-search-replace-questions">Template for Search/Replace Questions</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regular-expressions-regex-documentation">FAQ: Where to find regular expressions (regex) documentation</a></li>
<li><a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">Notepad++ Online User Manual: Searching/Regex</a></li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/72744</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72744</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 06 Jan 2022 22:03:52 GMT</pubDate></item></channel></rss>