ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: swieber on November 14, 2023, 02:46:49 PM

Title: Extract capture date form file format whatsapp
Post by: swieber on November 14, 2023, 02:46:49 PM
Hi all,

I want to Put files based on capture dates into folders with a tool which uses capture date. How do i extract and set capture date from this file format from whatsapp.

00077918-PHOTO-2023-11-05-14-18-37

Regards,

I am sorry if this question is answered before. i am a newbie.
Title: Re: Extract capture date form file format whatsapp
Post by: StarGeek on November 14, 2023, 03:17:36 PM
It would be something like this
exiftool "-Directory</path/to/newdir/${Filename;m=~/(\d{4}-\d\d-\d\d)/;$_=$1}" /path/to/files/

This extracts the Year-Month-Day from the filename and creates a directory with that name under /path/to/newdir/

Change /path/to/newdir/ to the directory path you want to move them to or if you want them sorted into subdirectories of their current location, change it to %d