Rename Job - add text after number of characters

Post Reply
ChritianK
Member
Posts: 43
Joined: Wed Nov 29, 2017 10:57 am

Rename Job - add text after number of characters

Post 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 !
Arthur
Member
Posts: 114
Joined: Sat Sep 09, 2017 11:58 pm
Location: Yateley, UK

Re: Rename Job - add text after number of characters

Post 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
Last edited by Arthur on Wed Jan 23, 2019 9:01 am, edited 1 time in total.
ChritianK
Member
Posts: 43
Joined: Wed Nov 29, 2017 10:57 am

Re: Rename Job - add text after number of characters

Post by ChritianK »

Thanks Arthur, it works great !

Best Regards,
Christian
jan_suhr
Advanced member
Posts: 592
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Rename Job - add text after number of characters

Post 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-"]
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
ChritianK
Member
Posts: 43
Joined: Wed Nov 29, 2017 10:57 am

Re: Rename Job - add text after number of characters

Post by ChritianK »

OK Thanks too Jan, I'll will test this too, it's a good idea !
Best Regards,
Christian
Altavia ACT
Newbie
Posts: 1
Joined: Tue Mar 26, 2019 10:35 am

Re: Rename Job - add text after number of characters

Post 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
🙏
Arthur
Member
Posts: 114
Joined: Sat Sep 09, 2017 11:58 pm
Location: Yateley, UK

Re: Rename Job - add text after number of characters

Post 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.
Post Reply