Math filenames from one path with filenames on another path

Discussion related to "Everything" 1.5 Alpha.
Post Reply
anmac1789
Posts: 673
Joined: Mon Aug 24, 2020 1:16 pm

Math filenames from one path with filenames on another path

Post by anmac1789 »

Hello everyone, besides using temporary omit results, is there a way to find a duplicate of another path? either with regex or custom column formulas?

For example, lets say I have all these files

file1.jpg - path: C:\google
file2.jpg - path: C:\google
file3.jpg - path: C:\google

and to find these same filenames in another part path and "pair them up" or match them, if the same filenames exist in the second path -- U:\facebook such that

file1.jpg - path: C:\google
file2.jpg - path: C:\google
file3.jpg - path: C:\google

will be paired with

file1.jpg - path: C:\google
file1.jpg - path: U:\facebook
file2.jpg - path: C:\google
file2.jpg - path: U:\facebook
file3.jpg - path: C:\google
file3.jpg - path: U:\facebook
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Math filenames from one path with filenames on another path

Post by void »

Please try the following fileexists: search:

<regex:^C:\\google\\([^\\]*)$ fileexists:U:\\facebook\\$1:> | <regex:^U:\\facebook\\([^\\]*)$ fileexists:C:\\google\\$1:>

Sort results by name.

fileexists:
anmac1789
Posts: 673
Joined: Mon Aug 24, 2020 1:16 pm

Re: Math filenames from one path with filenames on another path

Post by anmac1789 »

void wrote: Mon Apr 10, 2023 4:48 am Please try the following fileexists: search:

<regex:^C:\\google\\([^\\]*)$ fileexists:U:\\facebook\\meta\\$1:> | <regex:^U:\\facebook\\([^\\]*)$ fileexists:C:\\google\\$1:>

Sort results by name.

fileexists:
Okay so can you explain what is happening here..where is the double \\ coming from ? Where is facebook\meta coming from lol ?
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Math filenames from one path with filenames on another path

Post by void »

Sorry, please ignore the meta bit:

<regex:^C:\\google\\([^\\]*)$ fileexists:U:\\facebook\\$1:> | <regex:^U:\\facebook\\([^\\]*)$ fileexists:C:\\google\\$1:>

fileexists: uses regex \ escapes.
anmac1789
Posts: 673
Joined: Mon Aug 24, 2020 1:16 pm

Re: Math filenames from one path with filenames on another path

Post by anmac1789 »

void wrote: Mon Apr 10, 2023 5:25 am Ignore the meta bit:

<regex:^C:\\google\\([^\\]*)$ fileexists:U:\\facebook\\$1:> | <regex:^U:\\facebook\\([^\\]*)$ fileexists:C:\\google\\$1:>

fileexists: uses regex \ escapes.
Could this be extended to 3 paths to compare and match ?

For the path that I want to search, do I have to use C:\\ and U:\\ ?

No results are being shown...
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Math filenames from one path with filenames on another path

Post by void »

Please try the following to match subfolders/files:

<regex:^C:\\google\\(.*)$ fileexists:U:\\facebook\\$1:> | <regex:^U:\\facebook\\(.*)$ fileexists:C:\\google\\$1:>



You can compare as many paths as you like.
However, the search gets complicated:

For example, add M:\meta:

<regex:^C:\\google\\(.*)$ fileexists:U:\\facebook\\$1:> | <regex:^M:\\meta\\(.*)$ fileexists:U:\\facebook\\$1:> | <regex:^U:\\facebook\\(.*)$ fileexists:C:\\google\\$1:> | <regex:^M:\\meta\\(.*)$ fileexists:C:\\google\\$1:> | <regex:^C:\\google\\(.*)$ fileexists:M:\\meta\\$1:> | <regex:^U:\\facebook\\(.*)$ fileexists:M:\\Meta\\$1:>



Change C:\\ and U:\\ to the desired path.
anmac1789
Posts: 673
Joined: Mon Aug 24, 2020 1:16 pm

Re: Math filenames from one path with filenames on another path

Post by anmac1789 »

void wrote: Mon Apr 10, 2023 5:50 am Please try the following to match subfolders/files:

<regex:^C:\\google\\(.*)$ fileexists:U:\\facebook\\$1:> | <regex:^U:\\facebook\\(.*)$ fileexists:C:\\google\\$1:>



You can compare as many paths as you like.
However, the search gets complicated:

For example, add M:\meta:

<regex:^C:\\google\\(.*)$ fileexists:U:\\facebook\\$1:> | <regex:^M:\\meta\\(.*)$ fileexists:U:\\facebook\\$1:> | <regex:^U:\\facebook\\(.*)$ fileexists:C:\\google\\$1:> | <regex:^M:\\meta\\(.*)$ fileexists:C:\\google\\$1:> | <regex:^C:\\google\\(.*)$ fileexists:M:\\meta\\$1:> | <regex:^U:\\facebook\\(.*)$ fileexists:M:\\Meta\\$1:>



Change C:\\ and U:\\ to the desired path.

To clarify here's what I'm trying to do:

so for filename: IMG_20161106_215153_HDR.jpg it exists in the following paths:

"C:\Users\username\Desktop\email@gmail.com google photos\"
"U:\google takeout email@gmail.com\takeout-20230329T214336Z-001\Takeout\Google Photos\Photos from 2016\"
"U:\new shared album google photos\"
"U:\xiaomi mi cloud\Camera\"
"U:\xiaomi mi max (older version) REMOVE HERE\"
"Y:\DCIM\Camera\"

the next filename IMG_20161107_094035.jpg has the following paths:

"U:\new shared album google photos\"
"U:\xiaomi mi cloud\Camera\"
"Y:\DCIM\Camera\"

So I want to find & match only filenames which must exist in these paths only

"C:\Users\username\Desktop\email@gmail.com google photos\"
"U:\google takeout email@gmail.com\takeout-20230329T214336Z-001\Takeout\Google Photos\Photos from 2016\"
"U:\new shared album google photos\"
"U:\xiaomi mi cloud\Camera\"
"U:\xiaomi mi max (older version) REMOVE HERE\"
"Y:\DCIM\Camera\"
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Math filenames from one path with filenames on another path

Post by void »

The easiest way of doing that in Everything is:

Code: Select all

"C:\Users\username\Desktop\email@gmail.com google photos\*" | "U:\google takeout email@gmail.com\takeout-20230329T214336Z-001\Takeout\Google Photos\Photos from 2016\*" | "U:\new shared album google photos\*" | "U:\xiaomi mi cloud\Camera\*" | "U:\xiaomi mi max (older version) REMOVE HERE\*" | "Y:\DCIM\Camera\*" dupe:name
anmac1789
Posts: 673
Joined: Mon Aug 24, 2020 1:16 pm

Re: Math filenames from one path with filenames on another path

Post by anmac1789 »

void wrote: Mon Apr 10, 2023 6:18 am The easiest way of doing that in Everything is:

Code: Select all

"C:\Users\username\Desktop\email@gmail.com google photos\*" | "U:\google takeout email@gmail.com\takeout-20230329T214336Z-001\Takeout\Google Photos\Photos from 2016\*" | "U:\new shared album google photos\*" | "U:\xiaomi mi cloud\Camera\*" | "U:\xiaomi mi max (older version) REMOVE HERE\*" | "Y:\DCIM\Camera\*" dupe:name
But this syntax shows filenames for which there are only 2 paths available:

"U:\xiaomi mi cloud\Camera"
"Y:\DCIM\Camera"

What I am looking for is filenames that exist in all 6 paths. Basically, "|" is for OR but I want AND notation which is supposed to be a space but 0 results found
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Math filenames from one path with filenames on another path

Post by void »

I'm not sure how practical this is...

Code: Select all

< regex:"^C:\\Users\\username\\Desktop\\email@gmail.com google photos\\([^\\]*)$" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com google photos\\$1:" fileexists:"U:\\new sharedalbum google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\new shared album google photos\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\xiaomi mi cloud\\Camera\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\xiaomi mi max (older version) REMOVE HERE\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com googlephotos\\$1:" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^Y:\\DCIM\\Camera\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:">
C code to produce search:

Code: Select all

	int main(int,char**)
	{
		int i;
		int j;
		char *paths[6] = {
"C:\\\\Users\\\\username\\\\Desktop\\\\email@gmail.com google photos",
"U:\\\\google takeout email@gmail.com\\\\takeout-20230329T214336Z-001\\\\Takeout\\\\Google Photos\\\\Photos from 2016",
"U:\\\\new shared album google photos",
"U:\\\\xiaomi mi cloud\\\\Camera",
"U:\\\\xiaomi mi max (older version) REMOVE HERE",
"Y:\\\\DCIM\\\\Camera",
};
		
		printf("---------------\r\n");
		
		for(i=0;i<6;i++)
		{
			if (i)
			{
				printf(" | ",paths[i]);
			}

			printf("< regex:\"^%s\\\\([^\\\\]*)$\"",paths[i]);
			for(j=0;j<6;j++)
			{
				if (j != i)
				{
					printf(" fileexists:\"%s\\\\$1:\"",paths[j]);
				}
			}

			printf(">",paths[i]);
		}
		
		return 0;
	}
anmac1789
Posts: 673
Joined: Mon Aug 24, 2020 1:16 pm

Re: Math filenames from one path with filenames on another path

Post by anmac1789 »

void wrote: Mon Apr 10, 2023 7:28 am I'm not sure how practical this is...

Code: Select all

< regex:"^C:\\Users\\username\\Desktop\\email@gmail.com google photos\\([^.]*)$" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\([^.]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com google photos\\$1:" fileexists:"U:\\new sharedalbum google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\new shared album google photos\\([^.]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\xiaomi mi cloud\\Camera\\([^.]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\xiaomi mi max (older version) REMOVE HERE\\([^.]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com googlephotos\\$1:" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^Y:\\DCIM\\Camera\\([^.]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:">
C code to produce search:

Code: Select all

	int main(int,char**)
	{
		int i;
		int j;
		char *paths[6] = {
"C:\\\\Users\\\\username\\\\Desktop\\\\email@gmail.com google photos",
"U:\\\\google takeout email@gmail.com\\\\takeout-20230329T214336Z-001\\\\Takeout\\\\Google Photos\\\\Photos from 2016",
"U:\\\\new shared album google photos",
"U:\\\\xiaomi mi cloud\\\\Camera",
"U:\\\\xiaomi mi max (older version) REMOVE HERE",
"Y:\\\\DCIM\\\\Camera",
};
		
		printf("---------------\r\n");
		
		for(i=0;i<6;i++)
		{
			if (i)
			{
				printf(" | ",paths[i]);
			}

			printf("< regex:\"^%s\\\\([^.]*)$\"",paths[i]);
			for(j=0;j<6;j++)
			{
				if (j != i)
				{
					printf(" fileexists:\"%s\\\\$1:\"",paths[j]);
				}
			}

			printf(">",paths[i]);
		}
		
		return 0;
	}
How do I use that C code ? lol does it have to be used within everything ?
anmac1789
Posts: 673
Joined: Mon Aug 24, 2020 1:16 pm

Re: Math filenames from one path with filenames on another path

Post by anmac1789 »

I'm not sure why nothing is showing up. Can you give me a short version example just to see from 2 folders instead ? What options do I need to have enabled?
therube
Posts: 5003
Joined: Thu Sep 03, 2009 6:48 pm

Re: MatCh filenames from one path with filenames on another path

Post by therube »

Name Dup in all cases

1. Searchstring
2. Searchstring AND "/my doc"
3. Searchstring AND "/ash"
4. Searchstring AND "/my doc" OR Searchstring AND "/ash"

The < > group your ORs so that the AND works as you want it.
.
Everything searchstring in multiple paths.png
Everything searchstring in multiple paths.png (79.68 KiB) Viewed 5608 times
anmac1789
Posts: 673
Joined: Mon Aug 24, 2020 1:16 pm

Re: Math filenames from one path with filenames on another path

Post by anmac1789 »

therube wrote: Mon Apr 10, 2023 6:26 pm Name Dup in all cases

1. Searchstring
2. Searchstring AND "/my doc"
3. Searchstring AND "/ash"
4. Searchstring AND "/my doc" OR Searchstring AND "/ash"

The < > group your ORs so that the AND works as you want it.
.
Everything searchstring in multiple paths.png
I'm not particularly trying to find all the names beforehand, but rather finding all the matching filenames in all 6 folders
therube
Posts: 5003
Joined: Thu Sep 03, 2009 6:48 pm

Re: Math filenames from one path with filenames on another path

Post by therube »

As written, leave out Searchstring, & it will search those 6 directories for duplicated names.

It is not searching for the same duplicated name in all 6 directories (necessarily), but rather any name duplicates (be they 2 or 3 or 4 or 5 or 6 matches) that are within any of the stated 6 directories.
anmac1789
Posts: 673
Joined: Mon Aug 24, 2020 1:16 pm

Re: Math filenames from one path with filenames on another path

Post by anmac1789 »

therube wrote: Mon Apr 10, 2023 6:41 pm As written, leave out Searchstring, & it will search those 6 directories for duplicated names.

It is not searching for the same duplicated name in all 6 directories (necessarily), but rather any name duplicates (be they 2 or 3 or 4 or 5 or 6 matches) that are within any of the stated 6 directories.
How do I use the AND operator “space” perhaps inside the < >

Oh I didn't want that..but are you saying to use something like this:

<path-part:"path1"|path-part:"path2"|path-part:"path3"> ??
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Math filenames from one path with filenames on another path

Post by void »

Sorry, I didn't escape some of the paths for regex, please try:

Code: Select all

< regex:"^C:\\Users\\username\\Desktop\\email@gmail\.com google photos\\([^\\]*)$" fileexists:"U:\\google takeout email@gmail\.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max \(older version\) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\google takeout email@gmail\.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail\.com google photos\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max \(older version\) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\new shared album google photos\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail\.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail\.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max \(older version\) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\xiaomi mi cloud\\Camera\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail\.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail\.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared albumgoogle photos\\$1:" fileexists:"U:\\xiaomi mi max \(older version\) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\xiaomi mi max \(olderversion\) REMOVE HERE\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail\.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail\.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^Y:\\DCIM\\Camera\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail\.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail\.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max \(older version\) REMOVE HERE\\$1:">
Just two paths to see if things are working:

Code: Select all

< regex:"^C:\\Users\\username\\Desktop\\email@gmail\.com google photos\\([^\\]*)$" fileexists:"U:\\google takeout email@gmail\.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:"> | < regex:"^U:\\google takeoutemail@gmail\.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail\.com google photos\\$1:">
anmac1789
Posts: 673
Joined: Mon Aug 24, 2020 1:16 pm

Re: Math filenames from one path with filenames on another path

Post by anmac1789 »

void wrote: Tue Apr 11, 2023 3:23 am Sorry, I didn't escape some of the paths for regex, please try:

Code: Select all

< regex:"^C:\\Users\\username\\Desktop\\email@gmail\.com google photos\\([^.]*)$" fileexists:"U:\\google takeout email@gmail\.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max \(older version\) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\google takeout email@gmail\.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\([^.]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail\.com google photos\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max \(older version\) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\new shared album google photos\\([^.]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail\.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail\.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max \(older version\) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\xiaomi mi cloud\\Camera\\([^.]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail\.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail\.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared albumgoogle photos\\$1:" fileexists:"U:\\xiaomi mi max \(older version\) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\xiaomi mi max \(olderversion\) REMOVE HERE\\([^.]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail\.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail\.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^Y:\\DCIM\\Camera\\([^.]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail\.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail\.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max \(older version\) REMOVE HERE\\$1:">
Just two paths to see if things are working:

Code: Select all

< regex:"^C:\\Users\\username\\Desktop\\email@gmail\.com google photos\\([^.]*)$" fileexists:"U:\\google takeout email@gmail\.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:"> | < regex:"^U:\\google takeoutemail@gmail\.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\([^.]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail\.com google photos\\$1:">
Do you mind showing me a screenshot on your end to see if its working ?

I noticed that you have "email@gmail\.com" is this supposed to be like this?

This is quite frustrating... I used double \\ in the path and " " for paths with spaces and still no results. I know for a fact the 2 folders I'm comparing have over 1300 photos that share the same filename. What am I even doing wrong ? I used the exact syntax that you used

Code: Select all

<regex:"^C:\\Users\\username\\Desktop\\xxx@gmail.com google photos\\Photos\\([^.]*)$" fileexists:"U:\\google takeout xxx@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:"> | <regex:"^U:\\google takeout xxx@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\([^.]*)$" fileexists:"C:\\Users\\username\\Desktop\\xxx@gmail.com google photos\\Photos\\$1:">
Any suggestions ???
anmac1789
Posts: 673
Joined: Mon Aug 24, 2020 1:16 pm

Re: Math filenames from one path with filenames on another path

Post by anmac1789 »

I've enabled /match_end_of_filename_with_dollar_sign=1 and /match_start_of_filename_with_caret=2 from viewtopic.php?t=9795 and retried using

<regex:"^C:\\Users\\username\\Desktop\\xxx@gmail.com google photos\\Photos\\([^.]*)$" fileexists:"U:\\google takeout xxx@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:"> | <regex:"^U:\\google takeout xxx@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\([^.]*)$" fileexists:"C:\\Users\\username\\Desktop\\xxx@gmail.com google photos\\Photos\\$1:">


it's still not showing any matching results from these 2 folders.

should path be like this: "^C:\...\\([^.]*)$" or should " " be only around the path like this ... ^"C:\...\\"([^.]*)$ ??
therube
Posts: 5003
Joined: Thu Sep 03, 2009 6:48 pm

Re: Math filenames from one path with filenames on another path

Post by therube »

(I don't have time presently, but I'd start simple.
c:/tmp/1 c:/tmp/2
put a few files in each of those directories, & see if you can get it working as you want.
And if you do, then, c:/tmp/3, c:/tmp/4... & once that is also working, then get further into your actually directories...)
anmac1789
Posts: 673
Joined: Mon Aug 24, 2020 1:16 pm

Re: Math filenames from one path with filenames on another path

Post by anmac1789 »

therube wrote: Tue Apr 11, 2023 4:45 pm (I don't have time presently, but I'd start simple.
c:/tmp/1 c:/tmp/2
put a few files in each of those directories, & see if you can get it working as you want.
And if you do, then, c:/tmp/3, c:/tmp/4... & once that is also working, then get further into your actually directories...)
I made 2 test folders with one .txt in both of those folders with the same name and it seems the problem is occurring with adding ([^.]*)$ <---

When I use a simple syntax such as

<regex:^"U:\\regex test folder 1\\"(.*)$ fileexists:"U:\\regex test folder 2\\"$1:> | <regex:^"U:\\regex test folder 2\\"(.*)$ fileexists:"U:\\regex test folder 1\\"$1:>



Then the note.txt file shows up in both directories and matches up. If I use ([^.]*)$ then nothing shows up even after rebuilding the entire C drive and U drive index. See screenshots below for proof.

Screenshot 2023-04-11 131318.jpg
Screenshot 2023-04-11 131318.jpg (59.93 KiB) Viewed 5525 times

Screenshot 2023-04-11 131152.jpg
Screenshot 2023-04-11 131152.jpg (81.87 KiB) Viewed 5525 times
Screenshot 2023-04-11 131100.jpg
Screenshot 2023-04-11 131100.jpg (78.59 KiB) Viewed 5525 times

There is another problem. When extending this to the original folders, files in both folders are not showing up (also after re-indexing the database). See more screenshots below.

Screenshot 2023-04-11 150004.jpg
Screenshot 2023-04-11 150004.jpg (137.89 KiB) Viewed 5517 times

As you can see here, I am trying to match the file from these 2 highlighted folders but when I use the regex command exactly the way it is above the results only show files from one of the folders, not both folders.

Screenshot 2023-04-11 150403.jpg
Screenshot 2023-04-11 150403.jpg (1.07 MiB) Viewed 5516 times
Untitled.png
Untitled.png (291.2 KiB) Viewed 5517 times
Also, as a further test, when I use folders -- \regex test folder 1\ and \regex test folder 2\ and put two of the same images in each folder, everything shows the files properly in both folders, When I use folders with special characters such as ( ), Regex does not match files using this folder. I'm assuming the problem is brackets in the folder name
anmac1789
Posts: 673
Joined: Mon Aug 24, 2020 1:16 pm

Re: Math filenames from one path with filenames on another path

Post by anmac1789 »

The problem still is that across 6 folders, duplicates are found which exist in one folders but aren't present in 5 other folders.

I'm seeing duplicate files in 3 folders, but not in the other 3 folders. I don't want this because it takes up time to look for the duplicates I actually want and it produced useless results. Only those duplicates that exist among 6 folders must show and if any file that doesn't exist in any 6 folders, must not have a result. are How can I use fileexist and regex together to only get duplicates which exist across all 6 defined folders ? and leave out any duplicates which are across 2 folders, 3 folders, etc..
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Math filenames from one path with filenames on another path

Post by void »

My regex was a little off again, please try:

Code: Select all

< regex:"^C:\\Users\\username\\Desktop\\email@gmail.com google photos\\([^\\]*)$" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com google photos\\$1:" fileexists:"U:\\new sharedalbum google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\new shared album google photos\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\xiaomi mi cloud\\Camera\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\xiaomi mi max (older version) REMOVE HERE\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com googlephotos\\$1:" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^Y:\\DCIM\\Camera\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:">

( ) = capture group
[^\\] = any character except \
* match previous element zero or more times.
anmac1789
Posts: 673
Joined: Mon Aug 24, 2020 1:16 pm

Re: Math filenames from one path with filenames on another path

Post by anmac1789 »

void wrote: Wed Apr 12, 2023 3:11 am My regex was a little off again, please try:

Code: Select all

< regex:"^C:\\Users\\username\\Desktop\\email@gmail.com google photos\\([^\\]*)$" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com google photos\\$1:" fileexists:"U:\\new sharedalbum google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\new shared album google photos\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\xiaomi mi cloud\\Camera\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^U:\\xiaomi mi max (older version) REMOVE HERE\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com googlephotos\\$1:" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"Y:\\DCIM\\Camera\\$1:"> | < regex:"^Y:\\DCIM\\Camera\\([^\\]*)$" fileexists:"C:\\Users\\username\\Desktop\\email@gmail.com google photos\\$1:" fileexists:"U:\\google takeout email@gmail.com\\takeout-20230329T214336Z-001\\Takeout\\Google Photos\\Photos from 2016\\$1:" fileexists:"U:\\new shared album google photos\\$1:" fileexists:"U:\\xiaomi mi cloud\\Camera\\$1:" fileexists:"U:\\xiaomi mi max (older version) REMOVE HERE\\$1:">

( ) = capture group
[^\\] = any character except \
* match previous element zero or more times.
have you tried this on your pc ?
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Math filenames from one path with filenames on another path

Post by void »

Yes, with different paths.
anmac1789
Posts: 673
Joined: Mon Aug 24, 2020 1:16 pm

Re: Math filenames from one path with filenames on another path

Post by anmac1789 »

void wrote: Wed Apr 12, 2023 3:19 am Yes, with different paths.
and lets say if you delete one file from one of the folders the other folders shouldnt show that same file since its not inside one folder?
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Math filenames from one path with filenames on another path

Post by void »

Deleting a file will not refresh the entire result list.
That would be too expensive.

You'll need to refresh your search.
This can be done by adding a space to the end of your search.
anmac1789
Posts: 673
Joined: Mon Aug 24, 2020 1:16 pm

Re: Math filenames from one path with filenames on another path

Post by anmac1789 »

ok i see so after every deletion or addition to a folder a space after the end of the syntax is necessary or rebuild thr database ?
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Math filenames from one path with filenames on another path

Post by void »

Changing the search is the easiest and quickest.

A rebuild will also work, but is overkill.
anmac1789
Posts: 673
Joined: Mon Aug 24, 2020 1:16 pm

Re: Math filenames from one path with filenames on another path

Post by anmac1789 »

void wrote: Wed Apr 12, 2023 4:41 am Changing the search is the easiest and quickest.

A rebuild will also work, but is overkill.
Ok let me try your syntax and get back to you. I see youve been busy lately lol
Post Reply