1

(3 replies, posted in Bugs and problems)

It will work installed in "C:\Program Files (x86)" too
if you work as administrator and with disabled "UAC".
Then user has write access to "C:\Program Files",
but every program start has also full rights on the PC,
Viruses also, so it's not recommended do work that way every day!
Google for "How do I know if I have Windows administrator rights?"

Better is to just give write access for one user or the whole group "users"
to an defined sub folder, such as "C:\Program Files (x86)\Siren"
Google fore "How do I give permission to users?"

Or do what Rémi says, do not install to "C:\Program Files" and not to "C:\Windows".
Create for example a own folder like "C:\MyTools" for such applications.



HTH?  cool

Additional explanation, if I may:

So Rémis' complete expression for your case would be:

%NN%N{2,1,1}%f(s/^.* \d\d(-\d\d\d-\d\d.*)$/\1/)

instead of:
%NN%N{2,1,1}%f(-11)

where the last one is a fix count,
and the first one is a flexible regular expression:
match everything from start till 'space', two digits,
then match and store a hyphen, three digits.... and so on.



And just in case you have more than two first digits
(as you didn't provide real names as examples...) use something like that:
%NN%N{2,1,1}%f(s/^.* \d+(-\d\d\d-\d\d.*)$/\1/)

Please note,

renaming '20' to '21' will give you an error message, because '21' is already present.




That's why I have added an temporary sign or string to the new name,
which is not already part of the file name, like here for example a '#'

%NN%N{2,1,1}%b(-7)#.%e





Explanation:
%NN >>> non numeric character string
%N{2,1,1} >>> first numeric character string and do the math
%b(-7) >>> seven last signs from BASE name
# >>> additional sign to prevent complicated file names
.%e >>> the orign extension



Do a second run to remove that sign again:
%f(s/#//)

From the Help:

   %n   : the selection number
   %np  : the selection number relative to the file path
          for example:
          File               %n        %np <----
          \Dir1\Img1.jpg     001       001 <--------
          \Dir1\Img2.jpg     002       002

          \Dir2\Img3.jpg     003       001 <--------
          \Dir2\Img4.jpg     004       002


So for example use

Expression: %b %np.%e


          \Dir1\Img001.jpg <--------
          \Dir1\Img002.jpg 

          \Dir2\Img001.jpg <--------
          \Dir2\Img002.jpg



Info from the help:

   %b   : the "base" name          (ie for "autoexec.bat" it is "autoexec")
   %np  : the selection number relative to the file path
   %e   : the name extension          (ie for "autoexec.bat" it is "bat")


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

                                             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

5

(2 replies, posted in Comments)

Great, download works as expected.

Thank you / merci / Danke schön


/Stefan

6

(2 replies, posted in Comments)

Hi Rémi, comment ça va?  big_smile

Do you still provide a download link for Siren 2.01?
You know, some people prefer small size of executable (0,5 MB <> 9 MB).

Me guess you have removed the download as you can't guarantee
that it still works with nowadays operation systems.

But maybe you can provide a hidden link without any announcement but which I can share with others.
Or, am I allowed to share my version of Siren 2.01 with others? (nothing big planned, just with some forum members)
But better (more official, looks more secure) and more easier to share for me if you would provide the download.


Thank you very much for Siren!


/Stefan

Maybe you can extract just what you get
and provide it as a kind of an un-named list.
Just like
%ID3-1
%ID3-2
%ID3-3
...
and the user have to lookup them self what he need,
without the help of a valid tag name.

8

(4 replies, posted in How to ...)

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


.

9

(2 replies, posted in Bugs and problems)

Right, since Siren can handle (work with) parts of file name only,

you have to use the correct anchors to get what you want to achieve:

%b(s/^(.+?)\.(.+)$/\1/)
%b(s/^(.+?)\.(.+)$/\2/)


Use ^...$ to tell the engine to match from begin till end of the origin string (file name).


- - -

FROM:
yyyy-mm-dd.something.else.ext
TO:
something.else.yyyy-mm-dd.ext
USE:
%b(s/^(.+?)\.(.+)$/\2.\1/).%e


- - -

Also I use the '+' multiplier here, instead of the '*' one,
since I think you want one-or-more instead of nothing-or-more.

- - -

To work only on files starting with an date like yyyy-mm-dd, better use
%b(s/^(\d{4}-\d{2}-\d{2})\.(.+)$/\2.\1/).%e
That way you can select many files and only the one starting with an date are renamed.



HTH?

- - -

And Michel, please use a more meaningful Topic next time, so everybody can better find what he is searching for. Thank you.
Topic: Regular expression
Topic: Regular expression gives me wrong result on switching parts

10

(8 replies, posted in Comments)

Hello to all and all the best for 2017!

Rémi, thank you for making Siren!


 

Cu

How about

%e-LiteralText_%nc.%e;%f[2];%f("_","-")

Or some other, non-used sign instead of the underscore.

12

(2 replies, posted in Bugs and problems)

Here too.
Windows, Siren 3.14

Leading % tricks Siren out and shows me "..\parentfoldername%filename.ext" in Current Name field.
Instead of "%filename.ext" only.


%f("%40","@")
22:26:57: Failed to rename "..\03-Test%40Dscn####.jpg" to "..\03-Test@Dscn####.jpg"
22:26:57: 1 error occurred

%f("%40","\\@")
22:28:25: Failed to rename "..\03-Test%40Dscn####.jpg" to "03-Test\@Dscn####.jpg"
22:28:25: 1 error occurred

But the Current Name is updated and shows the wanted Name now?
An F5 shows the truth again.

Q:

After my renaming:

FROM:
BorHtml.vbs
HutHtml.vbs
NewHtml.vbs
OldHtml.vbs


TO:
Html.vbs
Html.vbs
Html.vbs
Html.vbs

by Expression %f(4)

how can I prevent duplicate file names?



A:

To prevent duplicate file names, you can add an counter,
and to insert that number before the extension,
use %b(4).%e instead of %f(4):


So

%b(4)_%n.%e

gives you:

Html_001.vbs
Html_002.vbs
Html_003.vbs
Html_004.vbs




EXPLANATION:

Your expression:
The whole file name:      %f
Start at '4th' sign, dropping the first three: %f(4)

My expression:
The base file name:               %b
Start at '4th' sign, dropping the first three: %b(4)
The selection number:           %n
An dot and the origin ext:     .%e


More:

   %n   : the selection number

   %np  : the selection number relative to the file path

   %nc  : the selection number relative to a name "collision" (same beginnings)

   %ncs : same principle as "%nc" except that it is empty for
          the first element of the "collision group" and prefixed by a "_" for the others.

   %ncf : Same as "%nc" except that the path is not taken into
          account. Only the file name parts are compared

   %ncfs: Same as "%ncs" but on the file name parts

   %ns  : the number of selected files



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.
------------------------------------------------------------------------------------------------------------

                                             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

FROM:
Queen - Bohemian Rhapsody.flv
Snap - Cult of Snap.mp3
Technotronic - Megamix.mp3


TO:
QUEEN - Bohemian Rhapsody.flv
SNAP - Cult of Snap.mp3
TECHNOTRONIC - Megamix.mp3


USE:
%ub[1] - %b[2].%e






EXPLANATION:

  %b              : the "base" name
   [1] and [2] : substring of name, split at given separator
  %ub            : all characters upper case, here of the "base" name
   %e             : the name extension


So
%ub[1]  gives you the first substring of name, split at separator, and put all characters into upper case.
"- "         is Space-Hyphen-Space manually inserted by you.
%b[2]    gives you the second substring of name, split at given separator.
%e        gives you the name extension.




Detailed explanation:

Every variable can be postfixed by a "[]" modifier.
It will be split into an array of substrings following the
specified separator characters.
The usage is: "[ i, "s" ]"
   i   : number of the substring to extract.
         If negative, the extraction is done from the end.
         If "0" (zero), it's equivalent to the complete string
         without the beginning and ending spaces.
   s   : list of separator characters, optional.
         If it is not specified, the list defined in
         "Options/Modifications" is used.

I have set "File > Options/Modifications > Array elements separator" to " - "



You can put one or more character modifiers just after the "%":
   @ : accented characters to standard ASCII
       ('é' to 'e', 'ü' to 'u', 'Á' to 'A' ...).
   u : all characters upper case.
   l : all characters lower case.
   U : first character of each word upper case, the others
       lower case. The words are separated by the characters
       specified in "Options/Modifications".
   L : first character uppercase, the rest lowercase.


See Siren Help (?) for more explanation.







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

FROM:

Vacation5.jpg
Vacation23.jpg
Vacation101.jpg

TO:
Vacation005.jpg
Vacation023.jpg
Vacation101.jpg


USE:
%NN%N{3}.%e






EXPLANATION:


   %N   : a number contained in the base file name
          a digit can indicate its position (1 by default)


   %NN  : the "opposite" of %N: a non numeric string contained
          in the base file name
          a digit can indicate its position (1 by default)


The parameters of some "number" variables can be defined in
"Options" ("Numbers" sub-menu). They can be specified too direclty
in the expression inside a "{}" modifier (braces) that postfixes
the variable name.

For the numbers contained in the base file name: %N, %N1, %Nn ...
the usage is: "{ p, v, n }"
    p : size
    v : value to add (positive or negative)
    n : position of the number to extract.
        If negative, the extraction is done from the end.


   %e   : the name extension


See Siren Help (?) for more explanation.




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

Some thought


 is the UTF-8 BOM (Byte-Order-Mark)

That is normal inside an file, at the begin.

Do you see this on an file name? (is this really possible?) Or just in the preview?
Did you use %T, line extracted from a text file? (I don't know if %T have problem with UTF-8)






.

17

(0 replies, posted in How to ...)

Q: How to remove first three signs from file names like this:

BorHtml.vbs
HutHtml.vbs
NewHtml.vbs
OldHtml.vbs

TO:
Html.vbs
Html.vbs
Html.vbs
Html.vbs



A: That is easy with Siren, just use this expression: %f(4)


To prevent duplicate file names, better add an counter: %b(4)_%n.%e
Html_001.vbs
Html_002.vbs
Html_003.vbs
Html_004.vbs




EXPLANATION:

The whole file name:      %f
Start at '4th' sign, dropping the first three: %f(4)


The base file name:               %b
Start at '4th' sign, dropping the first three: %b(4)
The selection number:           %n
An dot and the origin ext:     .%e 



For more read the help about "String modifier : "( )"  >>>  Extraction"
String extraction: The usage is very near of the standard "substr" : ( starting position, [number of characters] )



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.
------------------------------------------------------------------------------------------------------------

                                             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

18

(7 replies, posted in Comments)

Hope you all had have a few happy festive days and I wish you all a happy new year 2016!

Thank you for making Siren!

Still a valuable nice peace of a handy application.





.

19

(7 replies, posted in Bugs and problems)

You know the '⁄ ', beside the normal '\', is a valid path delimiter in WindowsTM file system, but can trick-out applications.

How is a application feasible to know if user means a real path or, like you, just a simple char?


So best don't use \ ^ " / * ? : >< | in file names, even not unicode chars.
It may work for good, but fail with some apps or single functions tongue



In the meantime, after years, I even avoid periods in file name, and more and more don't use spaces too  lol

20

(13 replies, posted in How to ...)

Yes, negative numbers are not implemented for %T variable.

But you could had used SORT
for /D %i in (*) do @(sort /R "%i\dirfiles.txt" /O "%i\dirfiles.txt")


But DIR has also a reverse switch for the /O operator: -



I had two additional ideas:
1. prefix the temp file name  with zzz or 000 (zero) respective to sort them out
of the way, to be NOT the first / last file in folder.
2. add a (s///) modifier to the %T variable to remove that temp file name, if it is the only one in folder.



So I have testet this:

To get first file from folder (Note the zzz prefix) :
step 1:for /D %i in (*) do @(dir /b /a-d /on "%i" > "%i\zzzdirfiles.txt")
step 2: %T{%fa(s/$/\\zzzdirfiles.txt/),1}(s/zzzdirfiles.txt//);%b


To get last file from folder (Note the /o-n DIR switch and the 000 prefix):
step 1:for /D %i in (*) do @(dir /b /a-d /o-n "%i" > "%i\000dirfiles.txt")
step 2: %T{%fa(s/$/\\000dirfiles.txt/),1}(s/000dirfiles.txt//);%b



Of course we would use '000' and 'zzz' without extension as temp file name only, to make typing easier  cool


HTH?  big_smile

21

(13 replies, posted in How to ...)

Again cut post











(At least 60 seconds have to pass between posts. Please wait a while and try posting again.)

22

(13 replies, posted in How to ...)

Yes, negative numbers are not implemented for %T variable.But you could had used SORT for /D %i in (*) do @(sort /R

23

(13 replies, posted in How to ...)

Rémi wrote:
>I have already thought about expanding the expression syntax....
>Do not hesitate to give your ideas.


Just mention that trick to 'read files relative to folders' in the help file.
Read always first line from each file:
%T{  %fa(s/$/\\Text.txt/) , 1 }


Additional mention the way to 'read one file from Sirens' home folder':
%Pe the path to Siren's executable file 
Read lines from a single file, but relative to file selection in Siren list view:
%T{  %Pe(s/$/\\Text.txt/)     }
Of course, if you do not need this portable, relative path, you can also use the absolute path, like e.g.
%T{  "C:\\Tools\\SirenV3\\Text.txt"     }


- - -
BTW:
the relative path form works also for me:
%T{ %f(s///) ,1}
and
%T{ %b(s///) ,1}
instead of
%T{ %fa(s///) ,1}

24

(13 replies, posted in How to ...)

O.O

Great solution, Rémi!

- - -

%b_(%T{%fa(s/$/\\_SirenNumFiles.txt/),1} files)


works for me on Siren v3.


Even with spaces in  path.

- - -

Examples (some folders without '_SirenNumFiles.txt'):

Current name    New name    Sel    Type                   
Accents    Accents_(6 files)    004 Directory
Add-fitting-Zeros    Add-fitting-Zeros_( files)    005 Directory
AddSerialize inbetween    AddSerialize inbetween_(2 files)    006    Directory
AddSpacebetween Upper case Letter    AddSpacebetween Upper case Letter_(1 files)    007    Directory   
AddSpacebetweenLetterAndDigitsOrSymbol    AddSpacebetweenLetterAndDigitsOrSymbol_(4 files) 008 Directory
b    b_( files)    009 Directory


- - -

Explanation:

%b_ >>> origin base name, without extension.

( >>> A literal '(' sign.

%T{%fa(s/$/\\_SirenNumFiles.txt/),1} >>>
>>> %T{file path,1} expression
>>> plus %fa expression as file path
>>> with an additional '(s///)'- RegEx search&replace on that %fa expression.

%fa(s/$/\\_SirenNumFiles.txt/)
>>> match the end of the value of %fa
>>> and add an (here regex escaped) backslash
>>> plus a literal string (here: '_SirenNumFiles.txt')

files)  >>> literal ' files)' sings.


Fine!

Thanks Rémi :thumpsup:

25

(13 replies, posted in How to ...)

As an workaround, if you really need that feature NOW,
see here for basic idea >> http://scarabee-software.net/forum/view … d=446#p446


And here is such a AHK-script for Siren v3 for your purpose:

#SingleInstance, force
;1) Open Siren v3 and select the wanted folders.
;2) Switch to WinExplorer and execute this script with installed AutoHotkey application
;3) Switch back to Siren and watch what happens....
;================================================
;;;; THE STEPS....
;IF Siren gets the focus:
WinWaitActive, ahk_class wxWindowNR 
;================================================
  ;Enter Siren expression: %fa to get full path of selected folder
  ControlSetText, Edit1,`%fa, Siren
  ;Execute Siren command Ctrl+P
  Send ^p
  ClipWait 
  ;For each copied line (folder name) do:
  Loop parse, clipboard, `n , `r
{
        ;Skip header line:
        if A_Index = 1
            continue

       myLine :=A_LoopField 
       Loop, parse, myLine, %A_Tab%
       {
            ;myLine is tab-delimited.
            ;Get New Name field (2th field):
            if(A_Index = 2){
                vFolder := A_LoopField
                
                ;Read in the file content:
                vFile = %vFolder%\SirenNumfiles.txt
                if (FileExist(vFile)){
                    FileReadLine, vOutputVar,%vFile%, 1
                    myOut = %myOut%%vOutputVar%`r`n
                }
            }
       }
  }
;================================================
;OUTPUT:
;MsgBox OUT:`r`n%myOut%
clipboard := myOut   
WinActivate,  ahk_class wxWindowNR
;Enter Siren expression: "%b_(%C files)" for new name of selected folder:
ControlSetText, Edit1,`%b_(`%C files), Siren
ExitApp
;================================================