Mathematic operation in regular expression

If you need help on how to use the program
Post Reply
darkeststar
Posts: 3
Joined: 2016-12-18 13:25:39

Mathematic operation in regular expression

Post by darkeststar »

Hello,
first of all a great THANKS to the developer of this powerful tool!

I'm currently trying to rename a lot of photos and put the date/time into the filename. This works perfectly with the "Date & Time" feature.
e.g. 'Bild_'yyyymmddhhnnsse

But since some photos are taken in a different time zone I want to increase (or decrease) the hour value with a constant integer (like 1 or 2). Unfortunately I forgot to adjust the time in my photo camera before taking the photos. :/ I assume I have to do this in a second rename step (after the Date & Time) with regular expressions.
But I have no luck with that.

Can somebody please give me a hint how to trim the hour value of a file and put it in the filename?

Thank you in advance.
Uwe
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Hi,
Currently not possible; it is a feature I wanted to add since some time but back then I didn't find how to make an easy (and generic) system for that, and this didn't evolve since then.
Regular expression can match patterns but not modify the values found: only use extracted values as they are.
darkeststar
Posts: 3
Joined: 2016-12-18 13:25:39

Post by darkeststar »

Hi,
thanks for the fast response.
Ok, then I haven't overlooked it in the rich feature set. ;-)

I understand that it's not so easy to implement it in a generic way. In my case it would also be necessary to consider the wrap around after 23 respectively 11 (am/pm). Maybe this would be rather an extension of the "Date & Time"-feature?
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

I was thinking of an operation where one could indicate where in the name is the time (using fixed position, after/before a string, or using a regex), then shift that time be a few minutes/hours.
Then there are other problems: handling separators, handling what happens when going over/before midnight, the am/pm or 24-h format, etc. In the end it is a rather complex problem :D
darkeststar
Posts: 3
Joined: 2016-12-18 13:25:39

Post by darkeststar »

Yes, it is getting more complex as longer one think about it. :hihi:
Probably only few users would use or need such a feature.
If I have a little time I will look at your current "Date&Time" implementation. Maybe I'm getting a idea how to solve/implement it. :wink:
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

I could possibly merge that in the exif and date/time actions: have an option to shift date/time when getting it from the image.
That would not be very difficult, since at that moment the program know where the time is, since it is put in the name by itself :D
Only small problem is that I get the exif date/time as text, but it is easy to convert since it has a fixed format.
At the same time it would allow to change the format used for it.
Downside is that one can't change the date & time in files that already have it in their name (something that I could use sometimes, and for which I wrote a small tool just for my case - as in my files the time had a fixed position)
Post Reply