L, R suffix?

Post any Bulk Rename Utility support requirements here. Open to all registered users.

L, R suffix?

Postby ririri » Wed Mar 27, 2019 11:22 pm

I need help creating a L, R suffix for Bulk Rename Utility

Ex:
1_L.jpg,
2_R.jpg,
3_L.jpg,
4_R.jpg

Thanks!
ririri
 
Posts: 3
Joined: Wed Mar 27, 2019 11:18 pm

Re: L, R suffix?

Postby therube » Thu Mar 28, 2019 1:17 pm

Not understanding what you're wanting to do?

7:Add
Suffix: _L

Otherwise, do you want alternating L, R?
Like 1,3,5,7,9... are L
And 2,4,6,8,10... are R
?
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: L, R suffix?

Postby ririri » Mon Apr 01, 2019 11:52 pm

Hi therube,

I want alternating numbers. It's a suffix where L is always Odd 1,3,5... numbers and R is always Even 2,4,6...

Appreciate your insight. I have a large batch of images to rename.

therube wrote:Not understanding what you're wanting to do?

7:Add
Suffix: _L

Otherwise, do you want alternating L, R?
Like 1,3,5,7,9... are L
And 2,4,6,8,10... are R
?
ririri
 
Posts: 3
Joined: Wed Mar 27, 2019 11:18 pm

Re: L, R suffix?

Postby therube » Wed Apr 03, 2019 1:08 pm

It's going to be easier for me to cheat, & not finish, & not be correct either ... ;-)


Everything:
Code: Select all
file:  ext:jpg  regex:^[02468]\d*[02468]+[^\d]

That will find your (at minimum 2-digit) even [_R] files.

Likewise, regex:^\d+[13579] will find your (at minimum 2-digit) odd [_L] files.

Once you have your files, drag them into BRU.
(It may take more then one attempt. Drag & if they all didn't turn up, Clear in BRU, then drag again.)


Then,

7:Add -> Suffix: _R

for your evens, &

7:Add -> Suffix: _L

for your odds.

Imagine you could select the files in BRU too, but I'd find it easier with Everything.


My regex: also seems to be picking up:

022%5B1%5D_2.jpg, "022%" part
022(1).jpg, "022(" part

oddly & I'm not sure why?
Well I guess that is because of the [^\d] part.
I use that as my "anchor" to determine the end of a sequence of numbers.

But then with:

44072-1.jpg
44074_cap_123.jpg

the "-" & "_" are not being picked up, instead the regex: ending at "2" & "4" (respectively).
(Maybe [^\d] allows some chars but not others?)


I'll chew on it.
And others are free to jump in to set things better :-).
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: L, R suffix?

Postby therube » Wed Apr 03, 2019 1:21 pm

So, standing back for a moment...

Initially I did not have the ^[02468] part in there.
I was thinking that by adding that, it would pick up single digit even numbers - which it does, but when the rest of the parts of the regex: were included, it then makes the regex: wrong - even for 2-digit numbers (as in numbers starting with an odd number are not picked up) - so that needs to be removed.


Wait a minute, is this now right?
Code: Select all
file: ext:jpg regex:^\d*[02468]+[^\d]


Might be.

The only way for a number that starts with an odd digit to be even is if it is more then 1 digit (that odd digit) & ends in an even digit.
So that's good.

"1" cannot be even. But "10" is. So the regex: is good.
"2" is even & "2" is found. And so is "20", but not "21", so we're still good.


"2" is found.

Yep it is.
But then that makes me scratch my ear.
As in while it does work, makes me ponder just a bit more, "^\d*[02468]".
So... starts with 0 or more digits followed by an even number, so that also finds "2".
Which is different from starting with a digit, followed by an even number, which would not find "2" only "2[02468]", a 2-digit number.
So... even though \d* finds "2" the addition of [02468] does not necessitate that it be 2-digit. Hmm...


So ^\d* actually matches everything (the same as "regex:" [with no parameters]).
But when you then throw in [02468], you end up with even numbers... Hmm...


(All I've got time for at the moment. Neat.)
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: L, R suffix?

Postby ririri » Thu Apr 04, 2019 9:19 pm

Thanks so much!!!!! :shock: :D

I have not been able to read it all but will give it a look over when I have time to digest.
ririri
 
Posts: 3
Joined: Wed Mar 27, 2019 11:18 pm


Return to BRU Support