Numbering between parentheses

A swapping-ground for Regular Expression syntax

Numbering between parentheses

Postby sculetus » Thu Nov 02, 2017 1:20 am

I'm renaming hundreds of photo's which are run to a print-processing program after the renaming. The program wants to have the filenummbers between parentheses.
Example :
FOTO-SHOOT (01).JPG
FOTO-SHOOT (02).JPG
FOTO-SHOOT (03).JPG
FOTO-SHOOT (03).JPG

i can use the ( as a separator in the numbering field (10) but i still need the ) after the numbering.
Is it possible ?
Thanks in advance
sculetus
 
Posts: 2
Joined: Thu Nov 02, 2017 1:08 am

Re: Numbering between parentheses

Postby KenP » Thu Nov 02, 2017 1:34 am

I don't see any way to do it in one hit, you could rename the files using Numbering with the ( as the separator then use "Add (7) to add the ) as a suffix.
KenP
 
Posts: 199
Joined: Sat Jul 30, 2016 11:25 am

Re: Numbering between parentheses

Postby sculetus » Thu Nov 02, 2017 1:18 pm

I've tried that, but the ) comes at the end of the filename and BRU doesn't consider the numbering itself as a part of the filename. So if you look at my example you will get FOTO-SHOOT) (01.JPG i.s.o. FOTO-SHOOT (01).JPG
Maybe I have to do it in 2 stages. First stage is putting ( as a separater) an after renaming adding the ) as a suffix of the filename and rename again.
sculetus
 
Posts: 2
Joined: Thu Nov 02, 2017 1:08 am

Re: Numbering between parentheses

Postby KenP » Thu Nov 02, 2017 1:42 pm

sculetus wrote:Maybe I have to do it in 2 stages. First stage is putting ( as a separater) an after renaming adding the ) as a suffix of the filename and rename again.

That's what I meant by "you could rename the files using Numbering with the ( as the separator then use "Add (7) to add the ) as a suffix]" :wink:

I'm afraid I can't see any way to do it in one hit.



Is the reason you had 2 periods at the end of the file name because it's not the end of the file name ?
I assumed it was a typo :)

If that's the case then after renaming the files using Numbering you may be better of using regex.

Regex (1)
Match: (.*\(\d+)(.*)
Replace: \1)\2

Sorry but without proper examples of the file names it difficult to be precise about any solution.
KenP
 
Posts: 199
Joined: Sat Jul 30, 2016 11:25 am


Return to Regular Expressions