<?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[possible to delete almost duplicate lines?]]></title><description><![CDATA[<p dir="auto">I use the line operations to delete duplicate lines in a comma delimited text file. But I get left with a lot of this almost duplicate lines, where I want to only keep the longest line.<br />
Is this possible easily enough?<br />
The shorter lines have double comma at the end, in case not immediately visible. Longer has (usually) 2 chars between those commas<br />
example:<br />
I just want to keep the 2nd line<br />
G7ODA,IO93WS,<br />
G7ODA,IO93WS,PE,</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/27556/possible-to-delete-almost-duplicate-lines</link><generator>RSS for Node</generator><lastBuildDate>Mon, 01 Jun 2026 17:38:38 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/27556.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 01 Jun 2026 12:51:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to possible to delete almost duplicate lines? on Mon, 01 Jun 2026 15:23:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tenchyuk" aria-label="Profile: tenchyUK">@<bdi>tenchyUK</bdi></a>,</p>
<p dir="auto">Does order of the lines matter in the final results?<br />
Can there ever be 3 or more lines that you want to compress into one (ie, could there ever be three or more of the G7ODA lines, or will it always only be a single short and a single long?)</p>
<p dir="auto">Assuming order doesn’t matter, assuming never more than a pair of almost-duplicate lines:</p>
<pre><code>P01AZ,IO55WS,XY,
P01AZ,IO55WS,,
G7ODA,IO93WS,
G7ODA,IO93WS,PE,
</code></pre>
<ol>
<li><strong>Edit &gt; Line Operations &gt; Sort Lines Lexicographically Ascending</strong></li>
<li><strong>Search &gt; Replace</strong><br />
FIND WHAT = <code>^(.*?,.*?,),*\R\1</code><br />
REPLACE WITH = <code>$1</code><br />
SEARCH MODE = regular expression<br />
REPLACE ALL</li>
</ol>
<p dir="auto">End Result:</p>
<pre><code>G7ODA,IO93WS,PE,
P01AZ,IO55WS,XY,
</code></pre>
<p dir="auto">If one or both of my assumptions are wrong, provide enough example data to counter my assumptions (use the <code>&lt;/&gt;</code> button on the toolbar and put the text between the ``` lines it creates), showing both the original data, and how you want it to look at the end…</p>
<p dir="auto">(It’s possible to restore the order, by adding/removing numbers in extra steps… but that gets complicated, and I didn’t want to overwhelm you if the final order of data doesn’t matter.  Similarly, the FIND WHAT regex can be made more complex to handle removing one-or-more short lines, but if your data is as simple as my example, then this should be sufficient.)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105622</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105622</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 01 Jun 2026 15:23:03 GMT</pubDate></item></channel></rss>