News:

2023-08-10 - ExifTool version 12.65 released

Main Menu

exiftool newbie

Started by Archive, May 12, 2010, 08:54:32 AM

Previous topic - Next topic

Archive

[Originally posted by nohurti on 2009-03-04 07:00:34-08]

I've spent hours but I still haven't figured out how I can use exiftool to accomplish my goal. I apprechiate any help.

I want to recurse through a messy directory structure and for each .jpg file, write the full path and filename to that file's IPTC Caption tag.

I can at least assign any fixed text to all the files in this way but not the path and file information. I see there are many options to do lots of file moving and file renaming but this is different, all the filenames and locations remain the same, I just want to stuff the files with their own path and filename.

Thank you.

Archive

[Originally posted by bogdan on 2009-03-04 09:10:27-08]

Hi,

I hope, I understand what you're trying to accomplish... so try:

Code:
exiftool "-iptc:Caption-Abstract<$directory/$filename" c:\xx
-this will write into each file (inside c:\xx directory) it's path and filename.

After you're sure this is what you want, you can use -r option (recursive):

Code:
exiftool "-iptc:Caption-Abstract<$directory/$filename" -r c:\xx
-which will do the same for all underlying directories (that is, subdirectories of c:\xx).

To prevent making of (_original) backups, use -Overwrite_original option.

Above is for Windows usage -if you're not on Windows, then you should use single quote instead.

Notice: On Windows, directories are (visualy) separated by backslash... but when exiftool executes above command, normal (not back) slash is written. Not a big deal, though.

Greetings,

Bogdan

Archive

[Originally posted by nohurti on 2009-03-04 13:13:16-08]

Bogdan

Wow! that is it! Thank you so much, and such a complete answer.

It is very good as it is now, but, if I dare point out one imperfection: the diectory path shows up, even for all the deeply nested directories but not the full path (from the drive letter and root). I don't "need" that but now I'm curious that there just happens to be something in exiftool to allow for that. I did a search but couldn't find anything like "path".

Thanks to you, I can continue with my task.

Archive

[Originally posted by exiftool on 2009-03-04 15:59:03-08]

I'll have to run some tests to see how this behaves in Windows,
but the intent is for the Directory to contain the full directory
name starting with what was specified on the command line.
The only thing I'm worried about is the drive letter.  I'm using
the Perl File::Basename::dirname() routine to separate the directory
name here, and I'll have to check to see if that includes the drive letter.

- Phil

Archive

[Originally posted by exiftool on 2009-03-04 23:02:47-08]

I checked the File::Basename documentation, and it convinced me that
the drive letter should be included.  I fired up my Windows box and
verified that it indeed is.

So if you aren't getting a full path specification, it is because you aren't
giving one.  ExifTool will report the path beginning at the base directory
as entered on the command line.  So if you want a full directory name,
be sure to specify it that way.

- Phil