Multiple fileexist:
Multiple fileexist:
Is there a way to have multiple fileexist in a regex ? kind of like a check across multiple paths?
Re: Multiple fileexist:
Use regex: and ( ) to capture the name.
For example:
regex:^c:\\folderA\\([^\\]*)$
Use as many fileexists: terms as you like to compare with other paths.
fileexists:c:\\folderB\\\1 fileexists:c:\\folderC\\\1 fileexists:c:\\folderD\\\1 fileexists:c:\\folderE\\\1
Use \1 to reference the first regex capture group.
Each fileexists: call takes an absolute path.
Use a space for AND or | for OR.
Examples:
Show files in C:\FolderA where the file exists in C:\FolderB and C:\FolderC and C:\FolderD:
regex:^c:\\folderA\\([^\\]*)$ fileexists:c:\\folderB\\\1 fileexists:c:\\folderC\\\1 fileexists:c:\\folderD\\\1
Show files in C:\FolderA where the file exists in C:\FolderB or C:\FolderC or C:\FolderD:
regex:^c:\\folderA\\([^\\]*)$ fileexists:c:\\folderB\\\1 | fileexists:c:\\folderC\\\1 | fileexists:c:\\folderD\\\1
fileexists:
For example:
regex:^c:\\folderA\\([^\\]*)$
Use as many fileexists: terms as you like to compare with other paths.
fileexists:c:\\folderB\\\1 fileexists:c:\\folderC\\\1 fileexists:c:\\folderD\\\1 fileexists:c:\\folderE\\\1
Use \1 to reference the first regex capture group.
Each fileexists: call takes an absolute path.
Use a space for AND or | for OR.
Examples:
Show files in C:\FolderA where the file exists in C:\FolderB and C:\FolderC and C:\FolderD:
regex:^c:\\folderA\\([^\\]*)$ fileexists:c:\\folderB\\\1 fileexists:c:\\folderC\\\1 fileexists:c:\\folderD\\\1
Show files in C:\FolderA where the file exists in C:\FolderB or C:\FolderC or C:\FolderD:
regex:^c:\\folderA\\([^\\]*)$ fileexists:c:\\folderB\\\1 | fileexists:c:\\folderC\\\1 | fileexists:c:\\folderD\\\1
fileexists:
Re: Multiple fileexist:
isn't this supposed to be something likevoid wrote: ↑Wed Apr 12, 2023 7:29 am Examples:
Show files in C:\FolderA when the file exists in C:\FolderB and C:\FolderC and C:\FolderD:
regex:^c:\\folderA\\([^\\]*)$ fileexists:c:\\folderB\\\1 fileexists:c:\\folderC\\\1 fileexists:c:\\folderD\\\1
fileexists:
<regex:^"c:\\folderA\\([^\\]*)$" fileexists:"c:\\folderB\\$1:" fileexists:"c:\\folderC\\$1:" fileexists:"c:\\folderD\\$1:">
Re: Multiple fileexist:
The < > group is not required here.
You'll need to use the < > grouping if you wanted to show files from all paths.
For example, the following will only show files in C:\FolderA (where they also exist in C:\folderB):
regex:^"c:\\folderA\\([^\\]*)$" fileexists:"c:\\folderB\\$1:"
If you wanted to show files in both C:\FolderA and C:\FolderB (where they exist in both paths):
<regex:^"c:\\folderA\\([^\\]*)$" fileexists:"c:\\folderB\\$1:"> | <regex:^"c:\\folderB\\([^\\]*)$" fileexists:"c:\\folderA\\$1:">
They grouping is needed here to OR the two searches.
You'll need to use the < > grouping if you wanted to show files from all paths.
For example, the following will only show files in C:\FolderA (where they also exist in C:\folderB):
regex:^"c:\\folderA\\([^\\]*)$" fileexists:"c:\\folderB\\$1:"
If you wanted to show files in both C:\FolderA and C:\FolderB (where they exist in both paths):
<regex:^"c:\\folderA\\([^\\]*)$" fileexists:"c:\\folderB\\$1:"> | <regex:^"c:\\folderB\\([^\\]*)$" fileexists:"c:\\folderA\\$1:">
They grouping is needed here to OR the two searches.
Re: Multiple fileexist:
Ok i see, so the path inside regex will show in the results after it finds a match in the other folder. What if I leave the | (OR) ?void wrote: ↑Wed Apr 12, 2023 11:00 pm The < > group is not required here.
You'll need to use the < > grouping if you wanted to show files from all paths.
For example, the following will only show files in C:\FolderA (where they also exist in C:\folderB):
regex:^"c:\\folderA\\([^\\]*)$" fileexists:"c:\\folderB\\$1:"
If you wanted to show files in both C:\FolderA and C:\FolderB (where they exist in both paths):
<regex:^"c:\\folderA\\([^\\]*)$" fileexists:"c:\\folderB\\$1:"> | <regex:^"c:\\folderB\\([^\\]*)$" fileexists:"c:\\folderA\\$1:">
They grouping is needed here to OR the two searches.
Re: Multiple fileexist:
The OR (|) is needed, because generally, files will not match both: regex:^"c:\\folderA\\([^\\]*)$" AND regex:^"c:\\folderB\\([^\\]*)$"
Re: Multiple fileexist:
regex:^c:\\folderA\\([^\\]*)$ all this shows in the results is the parent folders inside the main folder.void wrote: ↑Wed Apr 12, 2023 7:29 am Use regex: and ( ) to capture the name.
For example:
regex:^c:\\folderA\\([^\\]*)$
Use as many fileexists: terms as you like to compare with other paths.
fileexists:c:\\folderB\\\1 fileexists:c:\\folderC\\\1 fileexists:c:\\folderD\\\1 fileexists:c:\\folderE\\\1
Use \1 to reference the first regex capture group.
Each fileexists: call takes an absolute path.
Use a space for AND or | for OR.
Examples:
Show files in C:\FolderA where the file exists in C:\FolderB and C:\FolderC and C:\FolderD:
regex:^c:\\folderA\\([^\\]*)$ fileexists:c:\\folderB\\\1 fileexists:c:\\folderC\\\1 fileexists:c:\\folderD\\\1
Show files in C:\FolderA where the file exists in C:\FolderB or C:\FolderC or C:\FolderD:
regex:^c:\\folderA\\([^\\]*)$ fileexists:c:\\folderB\\\1 | fileexists:c:\\folderC\\\1 | fileexists:c:\\folderD\\\1
fileexists:
Its still confusing to me how to use regex:^c:\\folderA\\([^\\]*)$ fileexists:c:\\folderB\\\1 fileexists:c:\\folderC\\\1 fileexists:c:\\folderD\\\1
Re: Multiple fileexist:
Please try the following search to include subfolders and files:
regex:^c:\\folderA\\(.*)$
Use the Regular Expression Match 1 column to see the text being captured.
fileexists: uses the same regex syntax.
Use \1 to recall the captured text.
regex:^c:\\folderA\\(.*)$
Use the Regular Expression Match 1 column to see the text being captured.
fileexists: uses the same regex syntax.
Use \1 to recall the captured text.
Re: Multiple fileexist:
Do you mean something like this:
<regex:^c:\\folderA\\(.*)$" fileexist:"folderB\\$1:"> ??
Re: Multiple fileexist:
$1: is the same as \1
The following should give the same results:
<regex:^c:\\folderA\\(.*)$" fileexist:"folderB\\$1:">
<regex:^c:\\folderA\\(.*)$" fileexist:"folderB\\\1">
regex:^c:\\folderA\\(.*)$" fileexist:"folderB\\\1"
The following should give the same results:
<regex:^c:\\folderA\\(.*)$" fileexist:"folderB\\$1:">
<regex:^c:\\folderA\\(.*)$" fileexist:"folderB\\\1">
regex:^c:\\folderA\\(.*)$" fileexist:"folderB\\\1"
Re: Multiple fileexist:
Unfortunately none of the 3 expressions work for me. I have even added quotation to the beginning of " <regex:^ " Same with the other 2 expressions
Re: Multiple fileexist:
Could you please share the exact path you are using? or a mock-up at least.
Re: Multiple fileexist:
Thanks for the sample folders.
You are using fileexist: instead of fileexists:
What results do you see with the search:
<regex:^"U:\\regex test folder 1\\(.*)$" fileexists:"U:\\regex test folder 1 \(brackets\)\\$1:">
You are using fileexist: instead of fileexists:
What results do you see with the search:
<regex:^"U:\\regex test folder 1\\(.*)$" fileexists:"U:\\regex test folder 1 \(brackets\)\\$1:">
Re: Multiple fileexist:
Lol, good catch that's my mistake
There is a typo above, it should be fileexists with the added plural -"s" added. Here is a screenshot of the above syntax,
This only shows note.txt in the top level. It doesn't show note.txt in subfolders
Re: Multiple fileexist:
I made the same typo!
Please try the following search to find both:
<regex:^"U:\\regex test folder 1\\(.*)$" fileexists:"U:\\regex test folder 1 \(brackets\)\\$1:"> | <regex:^"U:\\regex test folder 1 \(brackets\)\\(.*)$" fileexists:"U:\\regex test folder 1\\$1:">
Please try the following search to find both:
<regex:^"U:\\regex test folder 1\\(.*)$" fileexists:"U:\\regex test folder 1 \(brackets\)\\$1:"> | <regex:^"U:\\regex test folder 1 \(brackets\)\\(.*)$" fileexists:"U:\\regex test folder 1\\$1:">
Re: Multiple fileexist:
Yes this syntax finds diplicate files from both folders. Is therr a way to find a duplicate file in predefined deeper level subfolders or would something more simpler than regex be used for that purpose lioe path/* ?void wrote: ↑Wed Apr 19, 2023 10:54 am I made the same typo!
Please try the following search to find both:
<regex:^"U:\\regex test folder 1\\(.*)$" fileexists:"U:\\regex test folder 1 \(brackets\)\\$1:"> | <regex:^"U:\\regex test folder 1 \(brackets\)\\(.*)$" fileexists:"U:\\regex test folder 1\\$1:">