Not all files renamed by date - any suggestions?

Started by LP Canada, May 25, 2020, 05:13:30 PM

Previous topic - Next topic

LP Canada

Hi Phil - it has been a couple of years since bugging you with my questions but you were extremely helpful and I have successfully and repeatedly batch renamed all of my Images by date - this exiftool has been a lifesaver. I just recently changed to Windows 10 and thanks to your instructions I got it working. However I have a lingering question (happened in Windows 7 as well). Out of 581 images - 542 images files updated; 31 image files unchanged and 8 files weren't updated due to errors. Now I would imagine some of the issue might be that some images are from other people's phones sent to me and also some are screen shots. I am using the following in the command prompt: exiftool "-FileModifyDate<CreateDate" "-FileName<CrewteDate" -d%Y-%m-%d %H.%M.%S.%%e . This is what you provided for me and it works for most of my iPhone images excepts for the usual 10-30 or so. I had an issue with the iPhone videos (dates were all wrong) so ended up using this and it again works on most of the videos except for a handful: exiftool "FileModifyDate<CreationDate" "-FileName<CreationDate" -d %Y-%m-%d %H.%M.%S.%%e . Is there another formula or something I can twig to ensure that all files are renamed by date? If not I will live with what I have because either way it has saved me so much time in organizing my images. Thank you Phil.

LP Canada

Hi Phil - in addition to my question above, the other images that give me a problem are the ones I take with rapid shoot on my camera or iPhone - they all show up as the same date and this as duplicates, but of course they are not. Have you developed a work around for that? Just curious.

Phil Harvey

To make sure all files are renamed, add ""-FileName<FileModifyDate" as the first argument.

Then all writable files will be renamed unless there is an error.  If the errors are minor, add -m to ignore them and write the file anyway.

The work-around for duplicates is to use %c (ie. -d %Y-%m-%d %H.%M.%S%%-c.%%e) to add a copy number for duplicate files.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

LP Canada

Thank you Phil for your reply. Since I really have no clue what I am doing please excuse my ignorance here. So for my Images I should instead use:
exiftool ""-FileName<FileModifyDate" "-FileModifyDate<FileCreateDate" "-FileName<FileCreateDate" -d%Y-%m-%d %-m %H.%M.%S%%-c. %%e.
Have I written this correctly? I am not sure where to add the -m and the -c. Did I do it correctly? Would the
-c also work for images I create a duplicate of so I can make a similar but zoomed copy of the image?

Then for video:
exiftool ""-FileName<FileModifyDate" "-FileModifyDate<CreationDate" "-FileName<CreationDate" -d%Y-%m-%d %-m %H.%M.%S%%-c. %%e.
Is this correct? I changed FileCreateDate to CreationDate for my iPhone videos - it seemed to work better - but because I really have no clue what I am doing, does that make sense? For whatever reason it seemed to work better for the videos.

LP Canada

Hi Phil - I had one further question below regarding your suggestion - just hoping you can confirm that I wrote out the formula/argument correctly for both images and videos based on your recommendations. Thank you very much.

Phil Harvey

No. There is a LOT wrong with what you have written.  Pay attention to the spaces, and make sure you are using simple quotes, not fancy 66/99 quote characters.

There is other stuff wrong too.  So much that I'm not sure what you intended.  Maybe try reading the documentation, but I think you may want something like this:

exiftool "-FileName<FileModifyDate" "-FileModifyDate<FileCreateDate#" "-FileName<FileCreateDate" -d %Y-%m-%d %H.%M.%S%%-c.%%e .

But do you really want to set the FileModifyDate from FileCreateDate after using FileModifyDate to set the file name?  If so, that is the way to do it, but it would be an unusual thing to do.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

LP Canada

Well quite honestly I really haven't got a clue what I am doing - I initially copied what you gave me awhile ago and because I was renaming my Panasonic images by date and my iPhone images by date and videos by date off my iPhone, I seemed to be getting quite a few errors - I looked at the Exif data for all of my images - some said create date, created date, modify date and using your original formulas I adapted until I got fewer errors. I always get about 30 images that say error and then all my rapid shoot images taken with my iPhone or Panasonic were all identified by the tool as the same image. Based on your recommendation above (adding %c to get rid of images being identified as duplicates and adding FileNam>FileModifyDate as the first argument. I tried to decipher the suggestion and create the formula myself. Ha ha - as you can see I really have no clue what I am doing. I am just looking for a formula that will change my Panasonic and iPhone images name to the date time taken with few or no errors and rapid shoot items being tested as individual images, not duplicates. I was similarly looking for a modified formula to rename my videos again with few or no errors. Thanks so much for any help you can give me. I thank you for your first recommendations below, I guess I just don't know how to apply them.

Phil Harvey

If you just want to rename all of your files, and not write anything else, I would recommend this:

exiftool "-FileName<FileModifyDate" "-FileName<CreateDate" -d %Y-%m-%d_%H.%M.%S%%-c.%%e DIR

(where DIR is "." if the current directory is the one with the images)

If you have AVI videos, you have to add -ext+ avi to the command, or else they won't get written.

Any warnings produced by this command may be ignored because the file itself isn't modified.

Again, make sure you are using plain double quotes (the open and end quotes must be identical), and not fancy looking ones.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

LP Canada

Thank you very much Phil for your help. I appreciate it.