Regexp and mount job

Post Reply
DamienB
Newbie
Posts: 9
Joined: Mon Dec 16, 2019 2:43 pm

Regexp and mount job

Post by DamienB » Wed Apr 29, 2020 10:40 am

Bonjour,
j'ai la ligne suivante et je veux capturer chaine de caractère composée de 6 chiffres… problème, il me faut la deuxième.

Toto_1359_885642_240578_853624-2

Dans Mount Job, si je saisie dans Nom du dossier de travail > Définir le texte d'une seule ligne avec des variables ceci :

Job > Name Proper > Search : [0-9]{6}

Je capture le premier match : 885642

Hors je veux capturer le second : 240578

Comment trouver la regex qui va bien ?

laurentd
Member
Posts: 51
Joined: Wed Mar 13, 2019 2:06 pm

Re: Regexp and mount job

Post by laurentd » Wed Jun 10, 2020 10:48 am

You can not do this in one go, but here are 2 solutions:

Rename the job to the part you need using search and replace regex:
Search for regex .+_(\d{1,5})_(\d{6})_(\d{6})_.+ and replace with regex \3 (third captured string)
Set private data ID to the job's name: ID=[Job.NameProper], that's the info you need.
Rename the job back to its original name.

Or, more straightforward, use StringSplitter app.
https://www.enfocus.com/en/appstore/pro ... ngsplitter
 
StringSplitter.png
StringSplitter.png (98.41 KiB) Viewed 1383 times
Last edited by laurentd on Wed Jun 10, 2020 11:01 am, edited 1 time in total.
Laurent De Wilde, Solution Architect @ Enfocus

DamienB
Newbie
Posts: 9
Joined: Mon Dec 16, 2019 2:43 pm

Re: Regexp and mount job

Post by DamienB » Wed Jul 08, 2020 10:40 am

Thanks a lot late !

Because of Covid.

Post Reply