ExifTool Forum

ExifTool => Newbies => Topic started by: keanon on March 13, 2023, 12:37:39 PM

Title: Restoring filenames to recovered files using File Number tag
Post by: keanon on March 13, 2023, 12:37:39 PM
Hello, I'm looking for a way to batch rename a large number of files to img_#### where the #### is the last 4 digits of the File Number EXIF tag.

Does anyone have experience with this and maybe have a script on hand?

Thanks.
Title: Re: Restoring filenames to recovered files using File Number tag
Post by: Phil Harvey on March 13, 2023, 03:51:26 PM
Maybe something like this:

exiftool "-filename<img_${filenumber;$_=sprintf('.4d',$_ % 10000)}" DIR

- Phil