<?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[Replacing new line sign (&quot;&#x5C;n&quot;) when the line after starts with &quot;;&quot;]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I have a 600k rows file, and I have to delete all the new line signs (“/n”) that are followed by a new line beginning with “;”.</p>
<p dir="auto">Is there anyone that can help with it?</p>
<p dir="auto">Best,<br />
Piotr</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/25156/replacing-new-line-sign-n-when-the-line-after-starts-with</link><generator>RSS for Node</generator><lastBuildDate>Wed, 20 May 2026 04:29:33 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/25156.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 21 Nov 2023 12:27:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Replacing new line sign (&quot;&#x5C;n&quot;) when the line after starts with &quot;;&quot; on Tue, 21 Nov 2023 16:34:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> it is absolutely it, it works perfectly! Thank you so much!</p>
<p dir="auto">I’m a little bit embarrassed that I haven’t connected the dots…</p>
<p dir="auto">Thanks once again!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/90662</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/90662</guid><dc:creator><![CDATA[piotrtorchala]]></dc:creator><pubDate>Tue, 21 Nov 2023 16:34:33 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing new line sign (&quot;&#x5C;n&quot;) when the line after starts with &quot;;&quot; on Tue, 21 Nov 2023 15:59:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/piotrtorchala" aria-label="Profile: piotrtorchala">@<bdi>piotrtorchala</bdi></a> ,</p>
<blockquote>
<p dir="auto">FIND = ^(?!;)</p>
</blockquote>
<p dir="auto">This is why it’s always a good idea when asking for help to share what you tried: I had misinterpreted your original statement that you wanted to replace the newlines before a semicolon at the start of the line.  But it now that you showed that, I think that you really wanted to replace the newlines that <em>don’t</em> have a semicolon at the start of the next line.</p>
<p dir="auto">You actually had all the pieces that you needed: you just needed to replace the <code>;</code> in mine with the <code>(?!;)</code> from yours, and it would have worked as you wanted (if I’m understanding)</p>
<ul>
<li>FIND = <code>\r\n(?!;)</code><br />
REPLACE = <code>\x20</code> (or type a space in the replacement box)<br />
SEARCH MODE = <code>Regular Expression</code></li>
</ul>
<p dir="auto">If this still isn’t right, you will need to show both “before” and “after” data.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/90661</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/90661</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 21 Nov 2023 15:59:43 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing new line sign (&quot;&#x5C;n&quot;) when the line after starts with &quot;;&quot; on Tue, 21 Nov 2023 14:57:04 GMT]]></title><description><![CDATA[<p dir="auto">Thank you <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a>  for your support and all the tips.</p>
<p dir="auto">Answering your question:</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> said in <a href="/post/90659">Replacing new line sign ("\n") when the line after starts with ";"</a>:</p>
<blockquote>
<p dir="auto">or do you really have a Windows-style CR LF (\r\n)</p>
</blockquote>
<p dir="auto">I have a Windows-style (CRLF).</p>
<p dir="auto">Unfortunately, the guidance given is not solving my issue, maybe a description of how I identified the lines that have to be merged with previous lines would be helpful, accompanied by a screenshot example.</p>
<p dir="auto">To identify all lines that I would like to delete the \n from the line before I used the following search expression:</p>
<p dir="auto">FIND = ^(?!;)</p>
<p dir="auto">Example on how it looks in the data base:</p>
<p dir="auto"><img src="/assets/uploads/files/1700578227893-n.png" alt="N++.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto">Unfortunately, there is 10k+ of such lines within 600k+ lines file.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/90660</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/90660</guid><dc:creator><![CDATA[piotrtorchala]]></dc:creator><pubDate>Tue, 21 Nov 2023 14:57:04 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing new line sign (&quot;&#x5C;n&quot;) when the line after starts with &quot;;&quot; on Tue, 21 Nov 2023 14:04:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/piotrtorchala" aria-label="Profile: piotrtorchala">@<bdi>piotrtorchala</bdi></a>,</p>
<p dir="auto">First, thanks for <em>trying</em> to put in into a text box in your second post.  For future reference, the syntax is ``` , not ''' – I used moderator power to change it for you this time.   (If you have trouble remembering that, then just use the <code>&lt;/&gt;</code> button on the toolbar to insert the two lines of that sequence to start and end your example text.)</p>
<p dir="auto">And now, on to your question:</p>
<blockquote>
<p dir="auto">And I have to replace “/n” by " " in all lines not beginning with “;”. In this example: to replace “/n” in row 2 by " ".</p>
</blockquote>
<p dir="auto">Your subject says <code> Replacing new line sign ("\n") when the line after starts with ";"</code> but your example text says <code>/n</code> .  I believe you intended to say <code>\n</code> even in your example text.</p>
<p dir="auto">You are also not clear whether you have a literal backslash followed by a literal <code>n</code> before the <em>actual</em> newline character(s), or whether you were just trying to indicate that you have a newline sequence there.</p>
<p dir="auto">The other question becomes, do you really have just a unix-style <code>LF</code> (<code>\n</code>), or do you really have a Windows-style <code>CR</code> <code>LF</code> (<code>\r\n</code>) at the end of each line?  Because it will change the results.  (You can tell by <strong>View &gt; Show Symbol… &gt; Show End of Line</strong>, or just by looking near the lower-right of your Notepad++ status bar and see whether it says “Windows (CRLF)” or “Unix (LF)” down there.</p>
<p dir="auto">If the <code>/n</code> in your example text really means “I have a windows-style end-of-line sequence at the end of each line”, and you want to change any “end-of-line sequence followed by a semicolon” with just a space, then you could use</p>
<ul>
<li>FIND = <code>\r\n;</code><br />
REPLACE = <code>\x20</code> (or type a space in the replacement box)<br />
SEARCH MODE = <code>Regular Expression</code></li>
</ul>
<p dir="auto">If you truly have just a unix-LF-style line ending, then instead use:</p>
<ul>
<li>FIND = <code>\n;</code><br />
REPLACE = <code>\x20</code> (or type a space in the replacement box)<br />
SEARCH MODE = <code>Regular Expression</code></li>
</ul>
<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/21925/faq-desk-formatting-forum-posts">Formatting Forum Posts</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>
<li><a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regular-expressions-regex-documentation">FAQ: Where to find other regular expressions (regex) documentation</a></li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/90659</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/90659</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 21 Nov 2023 14:04:05 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing new line sign (&quot;&#x5C;n&quot;) when the line after starts with &quot;;&quot; on Tue, 21 Nov 2023 13:54:11 GMT]]></title><description><![CDATA[<p dir="auto">Here is the data sample:</p>
<pre><code>;01;ABC;ABC/n
;01;A/n
BC;ABC/n
;01;ABC;ABC/n

</code></pre>
<p dir="auto">And I have to replace “/n” by " " in all lines not beginning with “;”. In this example: to replace “/n” in row 2 by " ".</p>
]]></description><link>https://community.notepad-plus-plus.org/post/90652</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/90652</guid><dc:creator><![CDATA[piotrtorchala]]></dc:creator><pubDate>Tue, 21 Nov 2023 13:54:11 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing new line sign (&quot;&#x5C;n&quot;) when the line after starts with &quot;;&quot; on Tue, 21 Nov 2023 12:30:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/piotrtorchala" aria-label="Profile: piotrtorchala">@<bdi>piotrtorchala</bdi></a></p>
<p dir="auto">Please show a sample of your data; best to follow the instructions <a href="https://community.notepad-plus-plus.org/topic/22022/faq-template-for-search-replace-questions">HERE</a> for this type of question.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/90651</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/90651</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 21 Nov 2023 12:30:19 GMT</pubDate></item></channel></rss>