ExifTool > The "exiftool" Application

Sorting 200,000+ pictures

(1/2) > >>

R Javier:
Hello, I just recovered images from my hard disk which got accidentally formatted.
The recovered images are having the file name eg: f470941600.jpg
Is there any chance of recovering the old file names

For sorting the images I tried the following copy paste commands from the discussions

exiftool -d %Y_%m_%d '-filename<${filemodifydate}/%f.%e' ‘-filename<${datetimeoriginal}/${make;}_${model;}_%f.%e'  DIR
Gave a result in which the sorted filenames were
eg :NIKON CORPORATION_NIKON D3200_f470941600.jpg

Executing this command on fresh files
exiftool -r '-FileName<CreateDate' -d '%Y-%m-%d/%H_%M_%S%%-c.%%le'
Gave a result
eg: 16_15_29.jpg.  this appears to be the time created.

Later tried the command
exiftool -a FILE
The file creation date detail is showing in
Date/Time Created              : Date and time
Date/Time Original              : Date and time
Create Date                        : Date and time
Date Created                      : Only date
Date Created                     : Date and time
Noticed there were two places showing date created
Can anyone help me in writing a command which will give the following result
(CAMERA MODEL)_(CREATED DATE)_(CREATED TIME)_(1,2,3.. in case of duplicate files).jpg

Folder arrangement
(YEAR)_(MONTH)

Thank you in advance

Phil Harvey:
But what format date/time do you want, and which tag(s) do you want to use for the date/time, and what do you want to do if the model isn't available?

- Phil

R Javier:


Hi, I plan to arrange everything in the following manner.
Prefer the folders to be arranged by month in the format
MONTH_YEAR
example: 05_2012
              06_2012
              12_2012
              01_2013

Inside this folder the file to be named as
CAMERA MODEL_TIME_DATE_(1,2,3...duplicates).JPG

example:
For a picture taken on 15 MAY 2012 at 1630 hrs

CANON_EOS_70D_16_30_15_05_2012.JPG

And if there is a duplicate for the same file then
CANON_EOS_70D_16_30_15_05_2012_00001.JPG
CANON_EOS_70D_16_30_15_05_2012_00002.JPG

The tags which I want to use for finding the date/time is preferably : Date/Time Original, Create Date, Date/Time Created
At present I am dealing with only .JPG files
Hopefully the model, date and time details are available in all the files. Else for the cases

When MODEL is available

1)
If DATE is not available,
but MODEL and TIME available
It can be named as
MODEL_TIME.JPG
example : CANON_EOS_70D_16_30.JPG
In case of duplicates : CANON_EOS_70D_16_30_00001.JPG
                                 CANON_EOS_70D_16_30_00002.JPG
And put into a separate folder named : 2020_No date info

2)
If TIME and DATE not available,
only MODEL available
It can be named as
MODEL.JPG
In case of duplicates : CANON_EOS_70D_00001.JPG
                                 CANON_EOS_70D_00002.JPG
And put into a separate folder named : 2020_No time date info

3)
If TIME is not available,
but MODEL and DATE available
It can be named as
MODEL_DATE.JPG
example : CANON_EOS_70D_15_05_2012.JPG
In case of duplicates : CANON_EOS_70D_15_05_2012_00001.JPG
                                 CANON_EOS_70D_15_05_2012_00002.JPG
These can be put into the same folder format as mentioned above i.e : 05_2012

When MODEL is not available

4)
If MODEL is not available,
but TIME and DATE is available
It can be named as
IMG_TIME_DATE.JPG
example : IMG_16_30_15_05_2012.JPG
In case of duplicates : IMG_16_30_15_05_2012_00001.JPG
                                 IMG_16_30_15_05_2012_00002.JPG
These can be put into the same folder format as mentioned above i.e : 05_2012

5)
If MODEL and TIME is not available,
only DATE is available
It can be named as
IMG_DATE.JPG
example : IMG_15_05_2012.JPG
In case of duplicates : IMG_15_05_2012_00001.JPG
                                 IMG_15_05_2012_00002.JPG
These can be put into the same folder format as mentioned above i.e : 05_2012

6)
If MODEL and DATE is not available,
only TIME available
It can be named as
IMG_TIME.JPG
example : IMG_16_30.JPG
In case of duplicates : IMG_16_30_00001.JPG
                                 IMG_16_30_00002.JPG
And put into a separate folder named : 2020_No model date info

7)
If MODEL, TIME and DATE is not available
It can be named as just
IMG.JPG
In case of duplicates : IMG_00001.JPG
                                 IMG_00002.JPG
And put into a separate folder named : 2020_No model time date info


This is the main plan but anything close will also work.
Suggest changes or recommend a better sorting method.
Kindly guide

Thank you very much

Phil Harvey:
Wow, OK.  That took me quite a while to sort through these possibilities.

Try this command:

exiftool -@ my.args DIR

with the following my.args file:


--- Code: ----d
%H_%M_%d_%m_%Y
-testname=2020_No time date info/IMG%+5nc.%e
-testname<2020_No date info/IMG_${timecreated;s/:\d+$//;tr/:/_}%+5nc.%e
-testname<${datecreated#;s/(\d+):(\d+):(\d+)/${2}_$1}/IMG_${datecreated;s/(\d+):(\d+):(\d+)/${3}_${2}_$1}%+5nc.%e
-testname<${createdate#;DateFmt('%m_%Y')}/IMG_${createdate}%+5nc.%e
-testname<${datetimeoriginal#;DateFmt('%m_%Y')}/IMG_${datetimeoriginal}%+5nc.%e
-testname<2020_No time date info/${model;tr(a-z /)(A-Z_)d}%+5nc.%e
-testname<2020_No date info/${model;tr(a-z /)(A-Z_)d}_${timecreated;s/:\d+$//;tr/:/_}%+5nc.%e
-testname<${datecreated#;s/(\d+):(\d+):(\d+)/${2}_$1}/${model;tr(a-z /)(A-Z_)d}_${datecreated;s/(\d+):(\d+):(\d+)/${3}_${2}_$1}%+5nc.%e
-testname<${createdate#;DateFmt('%m_%Y')}/${model;tr(a-z /)(A-Z_)d}_${createdate}%+5nc.%e
-testname<${datetimeoriginal#;DateFmt('%m_%Y')}/${model;tr(a-z /)(A-Z_)d}_${datetimeoriginal}%+5nc.%e
--- End code ---

If this does what you want, then change all "testname" in my.args to "filename" to actually do the renaming.

Note that the first duplicate file will not have a number, and the second duplicate with have _00002 added to the name.  Adding _00001 to the first duplicate would be very difficult.

- Phil

R Javier:
Thank you very much Phil

The command executed beautifully.
All the images are now sorted and organised.

Navigation

[0] Message Index

[#] Next page

Go to full version