Maybe I am overlooking the solution, maybe it just isn't possible yet, I vainly searched for a solution for the following:
Example - whilst organizing files/folders.
In Explorer/Directory Opus, say I have a file name titled: file name xyz blah blah ... pdf
Based on the first part of that file I need to find -other- files and folders.
So, other files/folders starting with the first same characters, let's say first 10-12 characters or so.
My steps right now : 1) select file, 2) hit f2, 3)select fist words/characters, 4)ctrl-c, 5)escape, 6)paste clipboard in Everything search box.
Q: Would there be a command line instruction to do this (based on first 12 characters)?
(BTW - am facing the below issue on a very regular basis)
Thanks.
Search other files and folders based on first x characters of a given file name
Re: Search other files and folders based on first x characters of a given file name
regex:(.{12}) add-column:1 dupe:1regex: = enable regular expressions.
( ) = capture group - Regular Expressions Match 1
.{12} = match 12 characters.
add-column:1 = show the captured text. (optional)
dupe:1 = find files with the same captured text.
regex:
add-column:
dupe:
Re: Search other files and folders based on first x characters of a given file name
Thanks a lot!
Will check and get back on this soonest.
(Have to go out now)
Will check and get back on this soonest.
(Have to go out now)
Re: Search other files and folders based on first x characters of a given file name
I'm confused, your example works, but If I want to grab the whole name and add an extention it doesn't.
regex:(.+)\.rar add-column:1 dupe:1Should be the same logic.
Last edited by puzzle on Mon Mar 03, 2025 9:27 pm, edited 2 times in total.
Re: Search other files and folders based on first x characters of a given file name
".rar" does not necessarily mean that it's the extension. The following files would be matched too:
I.love.rare.earth.magnets.txt
archive.rar.lnk
What exactly are you trying to find and show in the resultlist?
I.love.rare.earth.magnets.txt
archive.rar.lnk
What exactly are you trying to find and show in the resultlist?
Re: Search other files and folders based on first x characters of a given file name
The thing is they don't, at all, even if you add $ at the end like soNotNull wrote: Mon Mar 03, 2025 11:04 pm ".rar" does not necessarily mean that it's the extension. The following files would be matched too:
regex:(.+)\.rar$ add-column:1 dupe:1it still doesn't show any matches.
Same as the ts I was trying to find files and folders that share the same base name (without extension) as any .rar files in the directory to find duplicates.
This is not the real task though, I was just playing around to see if I could solve something non-trivial using only this app.
Re: Search other files and folders based on first x characters of a given file name
Non-trivial is on the menu too 
puzzle wrote: Mon Mar 03, 2025 11:24 pm to find files and folders that share the same base name (without extension) as any .rar files in the directory to find duplicates.
Code: Select all
dupe:path exact:fileexists:$stem:.rarRe: Search other files and folders based on first x characters of a given file name
Maybe this is the regex query you were looking for?
(as said: be as precise and specific as possible in describing what you want and what the results should look like...)
Code: Select all
regex:^(.+)\.rar$ add-column:1 dupe:1Re: Search other files and folders based on first x characters of a given file name
Many thanks indeed.
All these dupe-checks show that I have to do a -lot- of cleanups!
All these dupe-checks show that I have to do a -lot- of cleanups!