ExifTool Forum

General => Metadata => Topic started by: neon013 on January 25, 2017, 06:04:46 AM

Title: Copy files to new directory based on Picasa face tag or keyword
Post by: neon013 on January 25, 2017, 06:04:46 AM

Newbie.

Is it possible to scan my original photos that have been tagged in Picasa and copy them to new directories based on both Picasa people tags and Picasa keyword tags i.e.

Original.jpg (tagged with John and Snowboarding in Picasa) copied to new directories   John\Original.jpg and Snowboarding\original.jpg

Any attempts at this would be greatly appreciated.

Title: Re: Copy files to new directory based on Picasa face tag or keyword
Post by: Phil Harvey on January 25, 2017, 07:36:12 AM
First you have to figure out what tag Picasa uses for the keywords are store (see FAQ 2 (https://exiftool.org/faq.html#Q2)).  Assuming is the the "Subject" tag, you could use these commands to copy them:

1. exiftool "-directory<${subject;my @a=split /, /;$_=$a[0]}" -if "defined $subject" -o . DIR

2. exiftool "-directory<${subject;my @a=split /, /;$_=$a[1]}" -if "defined $subject and (()=$subject=~/, /g)>=1" -o . DIR

3. exiftool "-directory<${subject;my @a=split /, /;$_=$a[2]}" -if "defined $subject and (()=$subject=~/, /g)>=2" -o . DIR

... and so on for any additional keywords.

These commands will create the new directories in the current working directory.

- Phil