Page 1 of 1

Rename Job - add text after number of characters

Posted: Tue Jan 22, 2019 4:06 pm
by ChritianK
Hi,
I'm searching a way to add an expression into specific position in the JobName and didn't know how to to this.

For example, I need to add "-hd-" in JobName after position 10 from the first character of the JobName.

example : 1234567890myfile.jpg will be 1234567890-hd-myfile.jpg

I'm looking the RenameJob option and didn't find a way to do it.

Thanks a lot !

Re: Rename Job - add text after number of characters

Posted: Tue Jan 22, 2019 4:54 pm
by Arthur
1. Rename Job -> Search & Replace

Search For Regular Expression (\d{10})(.*)

Replace with: \1-hd-\2

- edit -
I assumed the first 10 characters are numbers. But should that not be the case, the RegEx to search for shall be:

(.{10})(.*)

Replacement is the same: \1-hd-\2

Re: Rename Job - add text after number of characters

Posted: Tue Jan 22, 2019 5:08 pm
by ChritianK
Thanks Arthur, it works great !

Best Regards,
Christian

Re: Rename Job - add text after number of characters

Posted: Tue Jan 22, 2019 5:14 pm
by jan_suhr
You can use the Rename Job if you do it in steps

First you have to set one folder to pick up the Job.NameProper as a Job.JobState variable

Action 1: Keep Segment 1-10

Action 2: Add suffix -hd-

Action 3: Add suffix [Job.JobState:Segment="11-"]

Re: Rename Job - add text after number of characters

Posted: Tue Jan 22, 2019 5:38 pm
by ChritianK
OK Thanks too Jan, I'll will test this too, it's a good idea !
Best Regards,
Christian

Re: Rename Job - add text after number of characters

Posted: Tue Mar 26, 2019 10:46 am
by Altavia ACT
Hi, can I ask you how you can replace by a captured group ?
I try but it doesn't work.

I have a regex

Code: Select all

-(FR|NL)$
I try to replace by

Code: Select all

_\1
or

Code: Select all

_$1
or

Code: Select all

_#1
I try with replace "inline value" and "define regular expression".

Image

Thanks for your help
🙏

Re: Rename Job - add text after number of characters

Posted: Tue Mar 26, 2019 11:26 am
by Arthur
the captured group shall be in {} I guess, not the regular ().
when it is defined as (NL|FR) it is literally taken as NL|FR not as either one or the other.