Select string by position and length

Started by frankdarwin, May 10, 2022, 09:51:25 PM

Previous topic - Next topic

frankdarwin

Hello,
I would like to rename files with the Renamer.
I want to append DateTimeOriginal to the original name. But I don't want to take DateTimeOriginal as it is represented in the metadata (DD.MM.YYYY:HH:MM), but in the form YYMMDD.
I know from different programming languages that you can select characters of a string based on their position and length.
I have also already searched on https://www.regular-expressions.info/, but unfortunately found nothing.
Can someone help me here?
Many thanks in advance.

thrinn

No need to use RegExp for this common task. You can use the format function to specify how the result should be formatted. E.g.
{File.DateTime|format:YYMMDD}
See also Date and Time Format. The whole Variables topic in the help has a lot of examples because variables are really flexible and powerful to use.
Thorsten
Win 10 / 64, IMatch 2018, IMA