Hi - newbie to Exiftool and GUI but looking like a could be a huge fan. Question - can someone help me with the command to take an existing tag in XPKeyword and build a filename structure around - XPKeyword - CreateDate- sequencenumber. I have several thousand JPG already tagged through Windows Gallery and cant see via Exiftool or exiftoolGUI how to correctly batch rename.
I think it should also be possible to create a folder structure around the XPKeyword and Year as well?
Thanks in advance for any help
If those are the tag names you want to use, the command would be:
exiftool "-filename<${xpkeyword} - ${createdate} - ${sequencenumber}" DIR
(note, use single quotes in Mac/Linux or double quotes as above in Windows)
Read about this feature in the -tagsfromfile documentation (https://exiftool.org/exiftool_pod.html#item__2dtagsfromfile_srcfile_or_fmt).
- Phil
Phil - thanks. The DIR on the end is the folder within which I want this command to take place? or something else?
I read something about creating a folder if one didnt exist?
The DIR is the directory containing the images you want to rename. If you add slashes in the filename, you can also create new directories, but I didn't do this in my example so the files will be renamed within the same directory.
Also, I realize that you will lose the extension in my example, so you should add ".%e" at the end of the format string to preserve the existing file extension.
- Phil
Hi,
Just a notice, to prevent further confussion.
There's a typo in:
exiftool "-filename<${xpkeyword} - ${createdate} - ${sequencenumber}" DIR
Correct is:
exiftool "-filename<${xpkeywords} ...
Bogdan
Quote from: BogdanH on August 05, 2011, 01:07:32 PM
Correct is:
exiftool "-filename<${xpkeywords} ...
Thanks. That didn't seem correct when I wrote it.
- Phil
Sorry guys being a bit stupid. I have tried
-filename<${xpkeywords} - ${createdate} - ${sequencenumber}.%e
(added .%e to keep JPEG extension )
but I think i have the string wrong...also the sequencenumber is not a metadata attribute, its just me trying to get
arrival of jonny- 001.JPG
arrival of jonny- 002.JPG
etc
What am i getting incorrect?!
JD
For this to work, all of the tags you used must exist in the file. Otherwise the file is not renamed. It sounds like the command isn't working because sequencenumber doesn't exist.
If you are just using sequencenumber to avoid conflicts, you can use %c instead for this purpose. Read the details of the -w option in the application documentation (https://exiftool.org/exiftool_pod.html) for more information.
- Phil
Give me about a week, I am almost finished. I earlier asked for some help with renaming image files from the tags inside XPKeywords.
I have created a FreeBasic program that uses Exiftool to pull out the XPKeywords and put it into a file to process. It just needs some finishing touches.
It will rename image files from a single directory and create a directory structure of renamed files.
For example say you have a file 100_3715.jpg in a directory called e:\favoritepictures that has these tags and was created on July 2, 2011 at 2:14 PM in the afternoon:
2_Bugs/Butterflies/American Lady
2_Bugs/Dragonflies/Damselflies/3_Bluets/3_Forktails_and_Sprites/1_Eastern_Forktail
This picture has two tags in it because it has an American Lady butterfly in it and an Eastern Forktail damselfly. Note too that I use number subscripts in the original tag to force Windows Live Picture Gallery and the output from the program to put images in taxonomic order.
It will create two files:
American_Lady_20110702_0214PM_01.jpg
1_Eastern_Forktail_20110702_0214PM_01.jpg
in these directories respectively:
e:\favoritepictures\2_Bugs\Butterflies\American_Lady
e:\favoritepictures\2_Bugs\Dragonflies\Damselflies\3_Bluets\3_Forktails_and_Sprites\1_Eastern_Forktail
This program takes care of a bunch of problems such as
- dealing with more than one tag in an image
- dealing with forbidden characters like ? and renaming spaces into underscores
- putting 01, 02 etc to prevent conflicts with photos taken in the same minute
- changing all / to \
- in my naming scheme '0_' is for location and these location tags will be filtered out in most uses of the program
When I am finished I will post it as a solution on the forum and in other places. Hopefully others will find it useful.
Cheers, Brent