[Originally posted by exiftool on 2007-02-05 19:57:21-08]This is a bit tricky, but possible. First I'll show you the command line, then
I'll explain how it works:
exiftool "-filename=%-.1d_%f.%e" "-directory=%d" dirname
The "%-.1d" takes all of the directory name but the last character (which is
the slash "/"). Without the trailing slash, the last directory name becomes part
of the filename. (See the -w option documentation for details on how these
format modifiers work.)
But a side-effect is that all files will be moved to their parent directories, since
a file with path "a/b/c.jpg" will get its name set to "a/b_c.jpg". So the
"-directory=%d" argument is added to override the file directory with
the original directory of the file.
In your example, you used "%c" instead of "%f". That may be intentional, and will
work, but will give the file a number instead of using the file name as you seem
to want from your description.
I hope this helps.
- Phil
[Originally posted by pdi on 2007-02-06 05:24:36-08]Phil,
Tricky it was, but so glad it was also possible. Many thanks for your time and your fast reply.
I used "%c" as a part of a DateTimeOriginal file naming scheme. With your help, the final command line is as follows:
exiftool -r "-filename<DateTimeOriginal" -d "%%-.1d_%y%m%d_%%.3c.%%e" "-directory=%d" dirname
This works like a charm, and lightning fast too :-)
Cheers,
pdi