Hi
I have several thousand photos sorted in year, month, day folders all with various names and want to change the name of them all to the following format:
ed-00000.jpg, ed-00001.jpg, ed-00002.jpg etc
Using the following command in Linux
exiftool -filename='ed%-.5c.jpg' -r dir
recursively changes all files but every time it enters a new directory it starts the renaming from 00000 again.
How do I get it to continue the sequence when entering the next directory?
To do this you must change gears and use a couple of different ExifTool features:
exiftool '-filename<ed-${filesequence;$_=sprintf("%.5d",$_)}.jpg' -ext jpg -r DIR
Here I added -ext jpg just in case there are other types of files around.
- Phil
Thanks for that Phil works great but it sometimes doesn't descend into the directories in date order so the file numbering is out.
e.g. In the 2013 directory it will rename the 05 directory before 03 directory.
Is there a way to prevent this?
Unless you specify a different order, the order for a file list is system dependent (but usually alphabetical on Unix systems).
However, you can specify the order with ExifTool. First sort on Directory, then FileName:
exiftool -fileorder directory -fileorder filename ...
I think this should do what you want.
- Phil
Cant try it right now, but that seems to be what I am after.
Thanks again for the quick help, much appreciated :)
Ed