|
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
|