Saturday, 8 December 2018

metadata - How can I rename Image with modified date and overwrite filename with number count using Jhead Tool?


A quick question... (Edited)


Year/Month/Day-Filename-001.jpg


  jhead -n%Y%m%d [(name)] 001 .jpg

(Not sure which options lets me create a filename after the year/month/day option in the usage documentation)



If it matters, I'm using a Mac.



Answer




I want to overwriting more than one image and a number count “001”, “002” ect.



For the example you provided in a comment to tfb's answer, sequentializing the filenames breaks when you use the %f option. With multiple input files you'd get:


$ ls *.jpg
foo.jpg foo2.jpg
$ jhead -n"%Y_%m_%d-%f-newname001" *.jpg
foo.jpg --> 2019_09_14-foo-newname001.jpg

foo2.jpg --> 2019_09_14-foo2-newname001.jpg

But if you omit %f, and add %03i, you'll get the following:


$ ls *.jpg
foo.jpg foo2.jpg
$ jhead -n"%Y_%m_%d-newname-%03i" *.jpg
foo.jpg --> 2019_09_14-newname-001.jpg
foo2.jpg --> 2019_09_14-newname-002.jpg

No comments:

Post a Comment

Why is the front element of a telephoto lens larger than a wide angle lens?

A wide angle lens has a wide angle of view, therefore it would make sense that the front of the lens would also be wide. A telephoto lens ha...