Page 1 of 1

Extract recording date from file name

Posted: Thu Dec 22, 2022 2:36 pm
by Horstlein
Hi Community!

I have a folder with very many photos. For some of them the date of taking is wrong. But the correct date is in the file name.
Is there any way to overwrite the date of taking of very many pictures with the date from the filename?

Re: Extract recording date from file name

Posted: Thu Dec 22, 2022 5:45 pm
by michel038
Hello,
There is a method, using ExifTool from within XnViewMP.
First step is to create an "Open with ... " entry in Tools menu . You can choose it's name like Name2date
You can see the general method here : viewtopic.php?p=178754#p178754 (If you are using Windows)

And we can try some ExifTool's parameters
If the name of your files contain no other digits than date and time, maybe this one will work
-k -m "-AllDates<Filename"

Select a copy of a file and try : Right-click, Open with Name2date
Exif dates will be updated, but file attributes won't, I think.

You will get a .bak backup of processed files.
If you are sure that the method is OK, you can add -overwrite_original to the exiftool parameters to prevent creation of bak files.

You can also use Exif:CreateDate or Exif:DateTimeOriginal instead of AllDates in the parameter

If it doesn't work or if you encounter error messages, tell us ...

Re: Extract recording date from file name

Posted: Thu Dec 22, 2022 7:11 pm
by user0
I would recommend Advanced Renamer, free and powerfull tool with handy UI
that saved me a lot of time in photo-handling tasks (usually just naming into YYMMDD_HHMMSS format).
I also managed to acomplish your usecase there as well.

Re: Extract recording date from file name

Posted: Fri Dec 23, 2022 12:19 am
by Gwenael Q.
Hello,

That's perfect timing !
I was about to make a request to add this feature as an option available for the "Import and sort" command !

Thanks for listening.