Searching for files of a particular length
Moderators: white, Hacker, petermad, Stefan2
Searching for files of a particular length
I want to find all files in a large directory whose names are greater than ten characters.
You'd think that this would work: ???????????*.*
But for some unknown reason, every file is returned. Huh? Why?
And what should I use instead?
You'd think that this would work: ???????????*.*
But for some unknown reason, every file is returned. Huh? Why?
And what should I use instead?
Re: Searching for files of a particular length
Check ☑ Regex option and search for
Code: Select all
.{11,}\.
Re: Searching for files of a particular length
Wonderful, ts4242, that works like a charm.
I just now looked at Help for Regex (a feature I'd never used before), and it was very very hard to follow. Do you happen to know if there's a simpler guide to it somewhere? I'd like to be able to create my own expressions using Regex, now that you've shown it to me.
Thanks!
I just now looked at Help for Regex (a feature I'd never used before), and it was very very hard to follow. Do you happen to know if there's a simpler guide to it somewhere? I'd like to be able to create my own expressions using Regex, now that you've shown it to me.
Thanks!
Re: Searching for files of a particular length
There are many guides and tutorials out there, i suggest you start with https://regexone.com/
Re: Searching for files of a particular length
It can also be done without regex, e.g. with a plugin like Filename_ChrCount in conjunction with a rule like this:on the Plugins tab in TC's search.
To do so: install the plugin (double-click, Enter), then open TC's search, switch to Plugins tab and set the values to the above.
HTH
Regards
Dalai
Code: Select all
Plugin: | Property: |OP:| Value:
filename_chrcount | Filename (Chrcount) | > | 10
To do so: install the plugin (double-click, Enter), then open TC's search, switch to Plugins tab and set the values to the above.
HTH
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: Searching for files of a particular length
*Great* tutorial, ts4242, thanks. Have been studying it.
So tell me. Is there any difference between these two?
(a|b|c)
[abc]
So tell me. Is there any difference between these two?
(a|b|c)
[abc]
Re: Searching for files of a particular length
There is no difference when it comes to matching, they will produce the same results.
But the first one will remember the match and it is possible to use in a replace.
If you want to look at from a textual description it is
a OR b OR c
one of the following, a or b or c
But the first one will remember the match and it is possible to use in a replace.
If you want to look at from a textual description it is
a OR b OR c
one of the following, a or b or c
Re: Searching for files of a particular length
The difference comes with other than such simple examples:
(abc|def|ghi) > match on 'abc' or 'def' or...
[abcdefghi] same as [a-i] >> match on any of that 'a' or 'b' or...
And (||) groups the query:
ab|c|d >>> match 'ab' or 'c' or...
a(b|c|d) >>> match 'ab' or 'ac' or..
(abc|def|ghi) > match on 'abc' or 'def' or...
[abcdefghi] same as [a-i] >> match on any of that 'a' or 'b' or...
And (||) groups the query:
ab|c|d >>> match 'ab' or 'c' or...
a(b|c|d) >>> match 'ab' or 'ac' or..
Re: Searching for files of a particular length
Thanks to everyone for this! I've been studying Regex the past couple of days, and feel like I'm starting to get a handle on it.
Currently, my only place to use it is in TC, but since I'm using that daily, I'll get practice with Regex for sure.
I'm curious why \w includes underscore but no other punctuation mark. There must be some reason for that anomaly!
Currently, my only place to use it is in TC, but since I'm using that daily, I'll get practice with Regex for sure.
I'm curious why \w includes underscore but no other punctuation mark. There must be some reason for that anomaly!