ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: pixelpicker on July 12, 2011, 08:46:00 AM

Title: Scan special named folders in subrirectories and write metadata-txt file
Post by: pixelpicker on July 12, 2011, 08:46:00 AM
Hello!

I'm using this wonderful exiftool since some time now - thanks for this timesaving helper, Phil!

I would like to scan an external harddisc G: for ALL folders AND subfolders witch have special words in their names - like: "Sommer" - and write iptc metadata of all those into a .txt file.

Up to now I have a script that does the job very well for subdirectories of one special level (here the second one):

exiftool -e -n -L -FileName -s -s -headline -caption-abstract -keywords -ObjectName "G:\*\*Sommer*" > "J:\Bilder txt Dateien\Bilder vom Sommer.txt"

But I need it for ALL levels of Folders / subfolder in G:.

Many greetings

Bette
Title: Re: Scan special named folders in subrirectories and write metadata-txt file
Post by: Phil Harvey on July 12, 2011, 09:53:34 AM
Hi Bette,

There is currently no exiftool option to do this.   There is a -i option which does almost the opposite of what you want, but this doesn't help.

One way to do this would be to use "grep" to filter the desired directory names from a full directory listing, then send these to exiftool.  But I don't know how to get a full directory listing in Windows.

- Phil
Title: Re: Scan special named folders in subrirectories and write metadata-txt file
Post by: pixelpicker on July 12, 2011, 10:14:17 AM
Hi Phil,

"But I don't know how to get a full directory listing in Windows." -> So do I  :)

Yes, the opposite -i option would have done the job perfectly.

Nevertheless - thank you for your information! So I will reorganize my data to use the old command.

Have a good day & many greetins

Bette
Title: Re: Scan special named folders in subrirectories and write metadata-txt file
Post by: pixelpicker on July 12, 2011, 11:23:06 AM
Hi Phil,

I am thinking: Is it possible to combine two or more commands to write this one txt file?
Something like:

exiftool -e -n -L -FileName -s -s -headline IF "G:\*\*Sommer*" OR "G:\*\*\*Sommer*"OR "G:\*\*\*\*Sommer*" > "J:\Bilder txt Dateien\Bilder vom Sommer.txt"

Or: Is it possible to add the Metadata of a new command to anexisting .txt file at the end? Like:

1) exiftool -e -n -L -FileName -s -s -headline "G:\*\*Sommer*" > "J:\Bilder txt Dateien\Bilder vom Sommer.txt"

2) exiftool -e -n -L -FileName -s -s -headline "G:\*\*\*Sommer*" ADDto > "J:\Bilder txt Dateien\Bilder vom Sommer.txt"

Many greetings

Bette
Title: Re: Scan special named folders in subrirectories and write metadata-txt file
Post by: Phil Harvey on July 12, 2011, 11:32:57 AM
You should be able to do both.

1) Specify as many directory names on the command line as you want

2) Use ">>" to pipe output and append to and existing file

- Phil
Title: Re: Scan special named folders in subrirectories and write metadata-txt file
Post by: pixelpicker on July 13, 2011, 08:27:53 AM
Dear Phil,

thank you very much! - this helps a lot. I did it like this:

exiftool -e -n -L -FileName -s -s -headline -caption-abstract -keywords -ObjectName "G:\*\*\*\*\*\*\*\*\*NAME*" "G:\*\*\*\*\*\*\*\*NAME*" "G:\*\*\*\*\*\*\*NAME*" "G:\*\*\*\*\*\*NAME*" "G:\*\*\*\*\*NAME*" "G:\*\*\*\*NAME*" "G:\*\*\*NAME*" "G:\*\*NAME*" "G:\*NAME*" > "J:\Bilder txt Dateien\Bilder vom NAME.txt"

It takes some time to run cause of the depth of levels, but like this one just has to find the deepest folder and create from this with the * placeholders all levels above to scan the whole harddisc. The piping >> can be used later to add only the new metadata right away when a folder with new images is created.

Have a good day.

Many greetings

Bette