Change year from filename and increment timestamp

Started by choppedfish, December 08, 2017, 08:04:01 PM

Previous topic - Next topic

choppedfish

Hi all. I'm a newbie, but i've hit a wall.

I'm trying to order files so that icloud will put them in years correctly and they will be sequenced in the years as well.

All files are set to 1st of Jan 2001 at 12:00am. I just need to get the Exif fields correct and I can then copy to the actual file itself.

exiftool.exe "-alldates=2001:01:01 00:00:00" -P -fileorder FileName -overwrite_original test/*.*

The above works fine.

My next 2 commands are as follows;
#1 - exiftool.exe "-datetimeoriginal+<0:0:${filesequence}10" -P -fileorder FileName -overwrite_original test/*.*
#2 - exiftool.exe "-alldates<${filename;$_=substr($_,0,4)}" 00:00 -n -fileorder FileName -overwrite_original test/*.*

The first sequences the minutes correctly so each file has a unique timestamp and I can easily play with this.

The second takes the first 4 numbers of the filename and uses it as the year. However in doing so it overwrites the timestamp.

Question 1:
Is there a way to preserve the timestamp on command #2 above?

Question 2:
can I do both command #1 and #2 as a single command. I did this but the results were weird...

exiftool.exe "-alldates<${filename;$_=substr($_,0,4)} 00:00 +0:0${filesequence}10" -n -fileorder FileName -overwrite_original test/*.*

NOTE: The above doesn't work. I did have it working but it would increment the time for the first file in each year, but not the subsequent files in the year. I did some other commands and exif reads the files in the correct sequence. I suspect combining the commands does not work as expected.

Thanks in advance

Byron

StarGeek

I would set the year from the filename first.  There's no need for the -fileorder here and it will just slow things down.
exiftool.exe "-alldates<${filename;$_=substr($_,0,4)}:01:01 00:00:00" -P -overwrite_original test/*.*

Then follow up with the increment.
exiftool.exe "-datetimeoriginal+<0:0:${filesequence}10" -P -fileorder FileName -overwrite_original test/*.*
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

choppedfish

Thank you so much. I wasted a day fiddling and googling and shazam you got it one.

Byron

StarGeek

Only because I've been fiddling for *checks reg date* over 6 years now. :D
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype