[Solved] 2 Questions - Wildcard and () Numbering?

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

[Solved] 2 Questions - Wildcard and () Numbering?

Postby DefAnt » Tue Sep 14, 2010 7:37 pm

I'm trying to figure out how to do Wildcards because there is a set of numbers in each photo that needs to stay the same. This is the work order number of the specific photo. Used for searching and locating specific photos.

The 2nd thing I wished to do is () numbering instead of single seperator numbering. Normally when you select multiple files and rename them, if you put nothing the 2nd file becomes (1), if you put (1), then it goes in sequence from there. Same goes for putting any number in the (), it will start from that number. However I can't get this program to do that. It will only do (# instead of (#).

Z 500229211 (1)
Z 500229211 (2)
Z 500229211 (3)
Z 500437449 (1)
Z 500437449 (2)
Z 500653851

Above is a list of a few photos that we have in our standard filing format.

Below is how we get them from our sources.

Alan - Z 500229211 car
Alan - Z 500229211 ladder
Alan - Z 500229211 door
Erik - Z 500437449 #1345
Erik - Z 500437449 #1346
Daniel - Z 500653851-1

As you can see, our sources send it to us. I have an automated program that takes their name from the email and appends it to the file. This is for our office use, in case the file name has a wrong number and we have to contact the source for a fix. Once all of the numbers are confirmed, I then have to manually adjust each one before we send it out to our client.


Is there a way to make an expression with a wildcard for the 5xxxxxxxx number so that it stays the same while everything else is editted?


Edit--

Ok I found an older post about wildcards, apparently the * in the Crop box of Section 6 followed immediatly by the character will remove up to and including that character. For example *- will remove the source name and the dash from all of my files. Which is good I guess, but then there's still the stuff after the file numbers that I need to remove :(. Oh and the Crop box has to be "Special". I was testing with this and *-** and so on does nothing lol. *5** starts removing the first digits but *5 will remove everything up to and including the 5. lol oh man... :)

Edit2 --

Found something that might work.
(.+)(\Z.+)(\ )
\2
The above 2 lines in the RegEx seems to work, only if there IS something after the file number. If there is nothing it fails to work because there is no space afterwards :(.

Still trying to figure out how I can do the proper Numbering sequencing. Oh well, tomorrow is another day.
Last edited by DefAnt on Wed Sep 15, 2010 6:49 pm, edited 1 time in total.
DefAnt
 
Posts: 16
Joined: Tue Sep 14, 2010 7:28 pm
Location: New Jersey, USA

Re: 2 Questions - Wildcard and () Numbering?

Postby Stefan » Wed Sep 15, 2010 7:31 am

Hi DefAnt, welcome.

I didn't read all (no time now) but i guess what you want.

FROM:
Alan - Z 500229211 car.jpg
TO:
Z 500229211.jpg
DO:
RegEx(1)
Match: .+\s(Z \d+)\s*.*
Repla: \1

Explanation:
.+ ==> match one of any-sign, one-or-more of the pattern just right before (that's one of any possible sign)
\s ==> match one blank space
(Z \d+) ==> match literal 'Z', blank, one digit, one-or-more of the pattern just right before (that's one digit). And "group" it for back reference by "\1".
\s* ===> match one white space (an blank), none-or-more of the pattern just right before (the blank). None-or-more will match if there is an space or not.
.* ====> match one of any-sign, none-or-more of the pattern just right before (one of any-sign). None-or-more will match if there is any additional sign or not.

- - -

FROM:
Z 500229211.jpg
TO:
Z 500229211 (1).jpg
DO:
Add(7) Suffix[ ()] (((that's: blank,open round bracket,closed round bracket)))
Numbering(10) Mode:Insert, At:-1 (((that's minus one. That means: not on last position, but at second last, right before the close bracket)))

Note: if you need to get something like:
Z 500229211 (001).jpg
use
Numbering(10) Pad:3
too.

HTH? :D , if not please reply.


DefAnt wrote:I'm trying to figure out how to do Wildcards because there is a set of numbers in each photo that needs to stay the same. This is the work order number of the specific photo. Used for searching and locating specific photos.

The 2nd thing I wished to do is () numbering instead of single seperator numbering. Normally when you select multiple files and rename them, if you put nothing the 2nd file becomes (1), if you put (1), then it goes in sequence from there. Same goes for putting any number in the (), it will start from that number. However I can't get this program to do that. It will only do (# instead of (#).

Z 500229211 (1)
Z 500229211 (2)
Z 500229211 (3)
Z 500437449 (1)
Z 500437449 (2)
Z 500653851

Above is a list of a few photos that we have in our standard filing format.

Below is how we get them from our sources.

Alan - Z 500229211 car
Alan - Z 500229211 ladder
Alan - Z 500229211 door
Erik - Z 500437449 #1345
Erik - Z 500437449 #1346
Daniel - Z 500653851-1

As you can see, our sources send it to us. I have an automated program that takes their name from the email and appends it to the file. This is for our office use, in case the file name has a wrong number and we have to contact the source for a fix. Once all of the numbers are confirmed, I then have to manually adjust each one before we send it out to our client.


Is there a way to make an expression with a wildcard for the 5xxxxxxxx number so that it stays the same while everything else is editted?


Edit--

Ok I found an older post about wildcards, apparently the * in the Crop box of Section 6 followed immediatly by the character will remove up to and including that character. For example *- will remove the source name and the dash from all of my files. Which is good I guess, but then there's still the stuff after the file numbers that I need to remove :(. Oh and the Crop box has to be "Special". I was testing with this and *-** and so on does nothing lol. *5** starts removing the first digits but *5 will remove everything up to and including the 5. lol oh man... :)

Edit2 --

Found something that might work.
(.+)(\Z.+)(\ )
\2
The above 2 lines in the RegEx seems to work, only if there IS something after the file number. If there is nothing it fails to work because there is no space afterwards :(.

Still trying to figure out how I can do the proper Numbering sequencing. Oh well, tomorrow is another day.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: 2 Questions - Wildcard and () Numbering?

Postby DefAnt » Wed Sep 15, 2010 3:48 pm

Wow - Exactly what I needed, with 1 small exception which I will try to figure out. The Numbering keeps going regardless if they are the same number. I love how you did the Add and at -1. That was brilliant. I didn't even know you could do negative for that.

I thought I might have to change the Type from Base 10, but it works fine compared to the other lower numbers of Type.

I found I could put in a # for Break, however the only problem I forsee with this is if the file number's last digit matches the next file number. Does it compare all digits up to the Break or just the digit at the specific point of Break? AHA! It does. I had 2 file numbers 501190256 and 501733366, the last digits matched but it still did (1) for both. :) Wonderful! I love this program.

Now the last and probably the least concerning minor problem is the photos that are by themselves. the (1)'s. This isn't needed... :/ Does anyone know if there is a way to exclude Numbering if there is only 1? lol probably not. oh well, not a big problem :)

Also - I didn't need to Pad the numbers, they came out fine, not (001) like you said it "might". Just to let you know :)

Thank you so much Stefan

Edit - LOL ran into another small problem. It's a strange one. Not sure if it's because the files are already numbered or because the source's name is 2 words. "Joe Z" instead of like "Alan" because it won't remove the beginning like the rest of the files, and because it doesn't remove that portion of the file, the break has to be higher in order to Number it correctly, and if I raise it to high, the other photos become (1) for everything which is weird.

Tried adding in a .+*\s* in the first portion of the RegEx but that didn't work.
Image
RegEx (1)
match ".+\s(WRE \d+)\s*.*"
replace "/1"
Repl. (3)
replace "wre"
with "WRE"
Remove (5)
D/S and Trim checked
Add (7)
Suffix " ()"
Numbering (10)
Mode Insert
at "-1"
Start "1"
Incr "1"
Break "13"
-Above is what you've given me with minor changes to fit the Client's Acronym required for the source files. I blacked out the others that work because they are email addresses but left the numbers to show they work perfectly. I do not know why it's ignoring the "Joe Z" tho when it works for everyone else.


EDIT - Solved.
Figured it out, it was doing Repl (3). Since the RegEx could not find a "WRE" it didn't work. I have to run it once to convert wre to WRE, then run it a 2nd time to complete the formula's expression.
DefAnt
 
Posts: 16
Joined: Tue Sep 14, 2010 7:28 pm
Location: New Jersey, USA


Return to BRU Support