<?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 lines with a date older than a week old.]]></title><description><![CDATA[<p dir="auto">Fellow Notepad++ Users,</p>
<p dir="auto">Could you please help me with the following search-and-replace problem I am having?</p>
<p dir="auto">I want to delete all lines with dates older than a week old.</p>
<p dir="auto">,0627,297,07/21/22 05:43 AM,322400-<br />
,0712,19273,07/06/22 12:05 PM,713020-<br />
,0713,2958,04/19/22 11:43 AM,714000-<br />
,0714,12908,07/19/22 05:14 PM,732000-</p>
<p dir="auto">Here is how I would like the data to look.</p>
<p dir="auto">,0627,297,07/21/22 05:43 AM,322400-<br />
,0714,12908,07/19/22 05:14 PM,732000-</p>
<p dir="auto">To accomplish this, I have tried using the following Find/Replace expressions and settings.</p>
<p dir="auto">I have found no help from someone doing this.</p>
<p dir="auto">Thank you.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/23284/delete-lines-with-a-date-older-than-a-week-old</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 10:52:02 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/23284.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 22 Jul 2022 15:54:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Delete lines with a date older than a week old. on Wed, 27 Jul 2022 22:08:16 GMT]]></title><description><![CDATA[<p dir="auto">Thank You ill give it a try.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/78749</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78749</guid><dc:creator><![CDATA[Dennis Prather]]></dc:creator><pubDate>Wed, 27 Jul 2022 22:08:16 GMT</pubDate></item><item><title><![CDATA[Reply to Delete lines with a date older than a week old. on Fri, 22 Jul 2022 17:43:44 GMT]]></title><description><![CDATA[<p dir="auto">Here’s a simple PythonScript that seems to accomplish the goal:</p>
<pre><code># -*- coding: utf-8 -*-
from __future__ import print_function

from Npp import *
import datetime as dt
import time

#-------------------------------------------------------------------------------

class T23284(object):

    def __init__(self):
        date_current = dt.datetime(*time.localtime()[:6])
        def replace_func(m):
            date_in_question = dt.datetime(*time.strptime(m.group(1), '%m/%d/%y')[:6])
            return '' if (date_current - date_in_question).days &gt; 7 else m.group(0)
        editor.rereplace(r'(?-s)^,\d*?,\d*?,(\d{2}/\d{2}/\d{2}).*(\R|\z)', replace_func)

#-------------------------------------------------------------------------------

if __name__ == '__main__': T23284()
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/78594</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78594</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 22 Jul 2022 17:43:44 GMT</pubDate></item><item><title><![CDATA[Reply to Delete lines with a date older than a week old. on Fri, 22 Jul 2022 17:21:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/25867">@Dennis-Prather</a> said in <a href="/post/78589">Delete lines with a date older than a week old.</a>:</p>
<blockquote>
<p dir="auto">I have tried using the following Find/Replace expressions and settings.</p>
</blockquote>
<p dir="auto">It cannot be done this way, because how are you going to tell Find/Replace what “a week” means?</p>
<p dir="auto">And why did you say “following” when nothing follows?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/78593</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78593</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 22 Jul 2022 17:21:38 GMT</pubDate></item><item><title><![CDATA[Reply to Delete lines with a date older than a week old. on Fri, 22 Jul 2022 17:19:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/25867">@Dennis-Prather</a></p>
<p dir="auto">Is there any reason you just didn’t continue posting to <a href="https://community.notepad-plus-plus.org/topic/23281/delete-lines-with-date-older-that-a-week">THIS</a> thread?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/78591</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78591</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 22 Jul 2022 17:19:11 GMT</pubDate></item></channel></rss>