Answer the question
In order to leave comments, you need to log in
How to get date from filename?
exiftool can write the creation date to exif using data from the file name, and it understands quite a few formats. Is there any utility that can extract the date from the name and that does not work according to a template, but determines the date format itself?
Here is an example of such files:
2018-06-11 19.16.34.jpg
IMG_20170803_124145.jpg
Or is it possible to somehow force exiftool to write metadata to webp files?
PS: I repeat, the date must be obtained from the file name, not from its metadata. And not in a fixed pattern.
Answer the question
In order to leave comments, you need to log in
Here 's a script for jhead just to sort through the various names. Might come in handy...
bash has a stat command
[email protected]:/storage# stat /script/xxx.file
File: /script/xxx.file
Size: 1030 Blocks: 8 IO Block: 4096 regular file
Device: 801h/2049d Inode: 45875204 Links: 1
Access: (0777/-rwxrwxrwx) Uid: (65534/ nobody) Gid: (65534/ nogroup)
Access: 2018-06-12 21:00:01.308455845 +0700
Modify: 2018-06-08 14:36:08.429939719 +0700
Change: 2018-06-08 14:36:08.429939719 +0700
#!/bin/bash
path=/xxx
if
then echo 0
else echo 1
fi
You can write an algorithm for parsing multiple patterns.
There is no single program that will automatically parse something like
YYYY-MM-DD hh.mm.ss.jpg
IMG_YYYYMMDD_hhmmss.jpg
.
BUT if you go through all your files, maybe there are only 3-4 formats, for parsing which a script in a couple of lines is enough.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question