[ antp.be > Forum ]

[ FAQFAQ - SearchSearch - MemberlistMemberlist - UsergroupsUsergroups - ]

[ RegisterRegister - ProfileProfile - Log in to check your private messagesLog in to check your private messages - Log inLog in ]


Mathematic operation in regular expression

 
Post new topic   Reply to topic    www.antp.be Forum Index -> Ant Renamer > Help
Author Message
darkeststar
PostPosted: 2016-12-18 14:46:37    Post subject: Mathematic operation in regular expression Reply with quote
View user's profile Send private message 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. oh well 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
PostPosted: 2016-12-18 16:11:35    Post subject: Reply with quote
View user's profile Send private message Visit poster's website 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
PostPosted: 2016-12-18 17:25:58    Post subject: Reply with quote
View user's profile Send private message 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
PostPosted: 2016-12-18 21:53:17    Post subject: Reply with quote
View user's profile Send private message Visit poster's website 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 grin
darkeststar
PostPosted: 2016-12-19 10:43:31    Post subject: Reply with quote
View user's profile Send private message Yes, it is getting more complex as longer one think about it. animated grin
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. animated wink
antp
Site Admin
PostPosted: 2016-12-19 17:58:35    Post subject: Reply with quote
View user's profile Send private message Visit poster's website 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 grin
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)
Display posts from previous:   
View previous topic :: View next topic  
Post new topic   Reply to topic    www.antp.be Forum Index -> Ant Renamer > Help All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
Template made by antp