Scan special named folders in subrirectories and write metadata-txt file

Started by pixelpicker, July 12, 2011, 08:46:00 AM

Previous topic - Next topic

pixelpicker

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

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

pixelpicker

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

pixelpicker

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

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

pixelpicker

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