mark by pattern using regular expression - help please

Advanced Renamer forum
#1 : 22/07-19 11:44
Charles BEAUJEAN
Charles BEAUJEAN
Posts: 5
Hi,

I have 3 files :
2019-07-18_11.49.JPG
2019-07-17_19.16!001.JPG
2019-07-17_19.16!002

I want to mark only those that contain the character "!".
I tried to use mark by patter with use regular expressions but I don't know how to do.

Please help me
Thanks


22/07-19 11:44 - edited 22/07-19 12:18
#2 : 22/07-19 20:51
David Lee
David Lee
Posts: 1125
It's not clear to me what you mean by "mark files".

The regex ".*!.*" will match all filenames that contain the character "!" but I'm not sure that is what you are wanting to do.


22/07-19 20:51
#3 : 23/07-19 18:20
Charles BEAUJEAN
Charles BEAUJEAN
Posts: 5
Reply to #2:
Hi,
This is exactly what I want but when I do that, there's a error. It says : A regular expression specified in RegEx is required.


23/07-19 18:20
#4 : 24/07-19 01:04
David Lee
David Lee
Posts: 1125
Reply to #3:
You will have to explain exactly what you are trying to do and which method you are applying otherwise it will be impossible to make any suggestions!


24/07-19 01:04
#5 : 24/07-19 10:40
Charles BEAUJEAN
Charles BEAUJEAN
Posts: 5
Reply to #4:
Hi,
It is true that I was not very precise in my request
I have a lot of files (+150) like this :
2017-08-15_15.01.JPG
2019-12-10_02.35&001.JPG
2019-12-10_02.35&002.JPG
2019-12-10_02.35&003.JPG
2019-08-03_12.25.JPG


I want to rename only the files with & like this :
2019-12-10_02.35&001.JPG -----> 2019-12-10_02.35.JPG
2019-12-10_02.35&002.JPG -----> 2019-12-10_02.35[01].JPG
2019-12-10_02.35&003.JPG -----> 2019-12-10_02.35[02].JPG

Thanks for your help


24/07-19 10:40
#7 : 25/07-19 00:17
David Lee
David Lee
Posts: 1125
Reply to #5:
This is rather more complex than you implied!

I suggest you do this in three steps...

1) Renumber the suffix (&xxx) by subtracting 1 so &001->&000, &002->&001 etc

2) Delete all occurrences of &000

3) Reformat &0xx to [xx]

So

1) Add a Renumber method...
Number position = 6
Change to = Relative to existing number
Number difference = -1
Zero padding = Automatic


2) Add a Replace method (to the same Method list)...
Text to be replaced = &000
Replace with = blank
Use regular expressions = not selected

3) Add a second Replace method...
Text to be replaced = &0(\d\d)
Replace with = [\1]
Use regular expressions = selected


25/07-19 00:17
#8 : 25/07-19 05:48
Charles BEAUJEAN
Charles BEAUJEAN
Posts: 5
Reply to #7:
Hi,

Thank you very much David Lee.
I start using Advanced Renamer and am really not comfortable with regular expressions.
Once again thank you, it will greatly simplify things for me.
Charles


25/07-19 05:48