M
M
Mamontov12021-12-08 23:12:41
Regular Expressions
Mamontov1, 2021-12-08 23:12:41

How to find files with a certain number of repetitions in Notepad++?

Good afternoon. Tell me, how in a huge number of files to display only those that match the number of matches?
For example show all files where "keyword" is 10 or more.
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dollar, 2021-12-09
@dollar

In notepad++ itself, no way . This is easier to write yourself as a console utility (if a programmer). This is a simple recursive traversal of the folder tree and for each file, counting occurrences.

O
Olgeir, 2021-12-14
@Olgeir

See the command cmd forfiles, it allows you to traverse the directory tree and execute the command you specify for each file.
The find command can count the number of occurrences.
The for command allows you to filter the output of the find command
. For example:
forfiles /p C:\Windows\System32\drivers\etc /m * /s /c "cmd /c for /f \"tokens=3 delims=:\" %a in ( 'find /c \"127\" @path') do @if %a GEQ 3 echo PaTh [%a]"
C:\Windows\System32\drivers\etc - the path from which we start looking
127 - the string we are looking for
3 - the number of line matches in the file from which we start to react.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question