Topic: Evaluate a sub expression / Store results for re-use

I hope you are still open for new ideas. If they are to wired, please feel free to drop them!!!


Evaluate a sub expression / Store results

Idea:

I don't know if that makes sense to you or if that can be implemented
in the way you have coded Siren, but here is the idea:


Calculate the result on a PART of the file name.

%(siren expression)
%#(siren expression)
%#(%b(9,10)_%nc)

Example: Add counter if signs 9 till 18 are same
%b(1,8) %#(%b(9,10)_%nc).%e

--------     --------     --------     --------     --------     --------     --------     --------     



Store some parts or results.

I had the problem, that after my first evalution, I can't no longer access parts of the origin name.
So me thinking about storing parts for later reuse.

%[name:siren expression]

%[name:siren expression] is a named Siren capture group to store the currently evaluated result
%[name] will insert the value of the Siren capture group named 'name', if any. Else nothing.

Examples, store part for later use:
Swap file name parts
%[one:%b(1,8)]; %[two:%b(9,10)]; %[two]%[one].%e
or
%[one:%b(1,8)]; %[two:%b(9,10)_%nc]; %[one]%[two].%e
or
Swap file name parts
%[one:%b(9,10)_%nc]; %b(1,8)%[one].%e



--------     --------     --------     --------     --------     --------     --------     --------     


Here is the callenge:

IMG_101_2015-05-15 <
IMG_102_2015-05-15
IMG_103_2015-05-17 <
IMG_104_2015-05-18 <
IMG_105_2015-05-19 <
IMG_106_2015-05-19
IMG_107_2015-05-19

I would like to rename at the end as follows:

IMG_101_2015-05-15_001 <-- #1 for day 15
IMG_102_2015-05-15_002
IMG_103_2015-05-17_001 <-- #1 for day 17
IMG_104_2015-05-18_001 <-- #1 for day 18
IMG_105_2015-05-19_001 <-- #1 for day 19
IMG_106_2015-05-19_002
IMG_107_2015-05-19_003



How would you solve this, without external scripting?

Re: Evaluate a sub expression / Store results for re-use

Hello,

An expression like this one might do it :
%b[-1]@%nc@%f;%f[3,"@"]_%f[2,"@"]

Using the name itself looks weird but it works well (for now).
Your idea is very interesting but maybe overkill.

Thanks for all your suggestions