You are here: PSPad forum > English discussion forum > Searching and deleting lots of unnecessary files.

Searching and deleting lots of unnecessary files.

#1 Searching and deleting lots of unnecessary files.

Posted by: maki | Date: 2020-01-11 19:42 | IP: IP Logged

Example. I have a lot of html files.
I want to find all files that contain code:

<font color="#FF0000">Ошибка 404: такой страницы на сервере нет</font>

AND

<h1 align="center">Произведение</h1>

If a file contains this code, I want to delete all of these files.

Maximum size html file: 1KB - 9KB

Edited 2 time(s). Last edit at 2020-01-11 19:46 by maki.

Options: Reply | Quote | Up ^


#2 Re: Searching and deleting lots of unnecessary files.

Posted by: pspad | Date: 2020-01-11 20:00 | IP: IP Logged

Use file manager. This isn't job of text editor
You can use Explorer what is part of Windows. It can do this job too.

Options: Reply | Quote | Up ^


#3 Re: Searching and deleting lots of unnecessary files.

Posted by: maki | Date: 2020-01-11 20:47 | IP: IP Logged

Hm.
I have a advanced search application.

Find: regex
File Types: *.html

Encoding:
Configured Encoding: 1251 (Cyrylic???)

I just need the regular expression for these two codes.

<font color="#FF0000">Ошибка 404: такой страницы на сервере нет</font>|<h1 align="center">Произведение</h1>

Edited 2 time(s). Last edit at 2020-01-11 20:56 by maki.

Options: Reply | Quote | Up ^


#4 Re: Searching and deleting lots of unnecessary files.

Posted by: maki | Date: 2020-01-11 20:58 | IP: IP Logged

Edit:

Solved.
Now, I have a list of unnecessary file names.
Now how do delete all files by this name list?

2019_01_01_1726.html(26): <h1 align="center"><font color="#FF0000">Ошибка 404: такой страницы на сервере нет</font></h1>

I can add names as regex, but it will be too long regex. No optimization.

The application has strengthening.
Unlimited regex length, even a trillion names, but a 100% CPU process all the time to complete.

Edited 1 time(s). Last edit at 2020-01-11 21:01 by maki.

Options: Reply | Quote | Up ^


#5 Re: Searching and deleting lots of unnecessary files.

Posted by: maki | Date: 2020-01-11 21:17 | IP: IP Logged

I made searching for unnecessary files a bit easier.
The files have similar file sizes.
The risk of error is minimal, that you accidentally delete a good file.

Regex: (2[0-8][0-9]{2}|29[0-8][0-9]|299[0-9])\.html

Size: =8,2KB

image

Edited 1 time(s). Last edit at 2020-01-11 21:21 by maki.

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2020 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR