ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: petr_riha on September 24, 2024, 11:34:33 AM

Title: Rename files due to time
Post by: petr_riha on September 24, 2024, 11:34:33 AM
Hi friends,

I'm new and have read many articles so far, but unfortunatelly I'm not able to rename my files... Can you please help me?

I have IMG_1234.heic, IMG_1235.heic, etc. in directory "photos".
I want to rename them due to create datetime, to format renamed/IMG_20240405_130457.heic, renamed/IMG_20240405_160309.heic, etc.

Can you please help me? I have read the manual but there are many examples and after hours watching into I feel so... blind and unable to find what I'm looking for.

Thanks a lot... :-)
Title: Re: Rename files due to time
Post by: StarGeek on September 24, 2024, 02:20:38 PM
This is the example command (https://exiftool.org/exiftool_pod.html#exiftool--FileNameCreateDate--d-Y-m-d_-H-M-S--c.-e-dir) you needed to look at. Only a few changes need to be made. I also added the %c variable to add a copy number if there is a filename collision.

I also set this to use Testname. This will show you want the new names will be without actually renaming. If it looks correct, change Testname into Filename.
exiftool -r "-Testname<CreateDate" -d IMG_%Y%m%d_%H%M%%-c.%%e /path/to/files/