Q: How can I increase the "hour" by one in my file names?
FROM (here YYYYmmDDhhMMss.txt):
20170523064530.txt
20170523082330.txt
20170523101730.txt
TO (here increase hour by one each):
20170523074530.txt
20170523092330.txt
20170523111730.txt
A: Use two steps, combined in one command line, delimited by an semicolon.
---
First Expression: %b(1,8)_%b(9,2)_%f(11)
That means:
Give me first 8 signs, from 1 to 8 ("%b(1,8)"), from the BASE name (%b).
That is in this example the "YYYYmmDD"-part.
Next add an symbol (underscore here) to seperate the different digit-parts to let Siren find the wanted digit to adjust.
And also we say: give me two signs starting at position 9 = "_%b(9,2)" = the "hh"-part.
Again add an symbol (f.ex. underscore) and ask for all signs from pos. 11 till the end = ("_%f(11)")
(Note here we use "%f" for "whole file name" to include the extension too)
(interim) Result:
20170523_06_4530.txt
20170523_08_2330.txt
20170523_10_1730.txt
---
Instead of renaming with step 1 and re-load the files again, just add a semicolon
between both Expression, and Siren will do two calculation of new names for you "at once".
---
Second Expression: %N1_%N2{2,1}_%N3.*
(So the complete Expression is now: %b(1,8)_%b(9,2)_%f(11) ; %N1_%N2{2,1}_%N3.*)
That means:
Give me the first found number (%N = "YYYYmmDD"-part = 20170523)
Add an symbol (f.ex. underscore) just to make the result most apparent (you can remove this afterwards)
Give me the second found number (%N2) and use modifier "{ p, v }" to do the math and increase the number by one.
(do you remember the modifier "{ p, v, n }" for the number variable?
or more clearly: "{ padding width, value for calculation, pos of number to extract from the name }")
Next add an symbol and ask for third number (%N3), following by adding the original extension ( ".*" -or- "%e" )
(test) Result:
20170523_07_4530.txt
20170523_09_2330.txt
20170523_11_1730.txt
---
So the complete Expression is (see the semicolon ";" between "(11)" and "%N1"?)
%b(1,8)_%b(9,2)_%f(11);%N1_%N2{2,1}_%N3.*
or rather without the extra debugging symbols:
%b(1,8)_%b(9,2)_%f(11);%N1%N2{2,1}%N3.*
(real wanted) Result:
20170523074530.txt
20170523092330.txt
20170523111730.txt
Solved?
See you next time...
Press the F1-key while you are in Siren to read more about.
Enjoy Siren, No installation needed, unzip and run. Siren stores it settings into an ini file, not in the Registry.
------------------------------------------------------------------------------------------------------------
Siren is a freeware file renaming program
- portable, highly flexible, powerfully -
If it's looking tricky it's easy to rename with Siren.
http://www.scarabee-software.net/en/siren.html
Now for Windows Win32 and GNU/Linux also:
http://scarabee-software.net/forum/viewtopic.php?id=273
.