ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: TT on February 28, 2012, 04:40:41 PM

Title: Ignore folders by wildcard?
Post by: TT on February 28, 2012, 04:40:41 PM
I'm trying to 'ignore' the processing of subfolders that contain a specific character in them, e.g, a "." .  Is there a way to do this?  Similarly, can wildcards be used with the -i switch?
Title: Re: Ignore folders by wildcard?
Post by: Phil Harvey on February 28, 2012, 10:47:18 PM
Sorry, currently -i does not support wildcards.  Offhand, I can't think of an easy way to do this.

- Phil
Title: Re: Ignore folders by wildcard?
Post by: TT on March 02, 2012, 12:37:29 PM
After I use Exiftool to create folders and move photos into them, I need a way to use -r while ignoring folders manually renamed from, say, yyyy\yyyy-mm-dd to yyyy\yyyy-mm-dd.vacation.spain . I don't want any folders that don't adhere to the 'default' convention of yyyy\yyyy-mm-dd -or- which contain some identifier such as, say, the "." .  Is there any way to lock out specific folders like this, without having to populate an ignore list?
Title: Re: Ignore folders by wildcard?
Post by: Phil Harvey on March 03, 2012, 07:02:56 AM
I just thought of a way to do this.  Not pretty, because it still accesses every file, but at least it should work:

in Mac/Linux:

exiftool -if '$directory !~ /\\./' -r DIR

in Windows:

exiftool -if "$directory !~ /\./" -r DIR

I'm pretty sure the backslash doesn't need to be escaped in Windows as it does in Mac/Linux, but I didn't test it to be sure.

This -if condition will fail for any file with a directory name containing a ".".

- Phil
Title: Re: Ignore folders by wildcard?
Post by: TT on March 03, 2012, 11:45:22 AM
Thanks Phil.  It worked like a charm.  I should have been able to figure it out .. it's so intuitive. ;-) ;-)

I haven't checked to see how much it affects the processing speed.

BTW, the \ didn't need escaping on Windows.