You are viewing limited content. For full access, please sign in.

Question

Question

split a token into single characters

asked on October 4, 2018

I am trying to create a workflow token that pulls characters from a file name.  

Is there a way to say I want to pull character positions 345 from a file name 123456AA7

0 0

Replies

replied on October 4, 2018

There are a number of methods available in Workflow to pull apart strings.

Would it be possible for you to provide some sample data? It doesn't have to be your exact file names, but it needs to accurately represent the patterns that you are working with. That'll make it a lot easier to help you out.

0 0
replied on October 4, 2018

This is the file name:

AWORPT_AWO1816500137_AC1311_SUBE93_V1_C0_DT180620140711

I am trying to pull position 11, 12 and 13 (181) It could be any character in these positions.

0 0
replied on October 4, 2018

Ok, here are a couple of options, depending on other variables.

All of these require you to use a regular expression in the Token Dialog when you assign the token.


This one works purely on position. Basically "get me the first three of any character after the first ten"

(?<=\A\w{10})\w{3}

This one assumes that the first part of the string is a consistent prefix. "Get me the first three of any character after the prefix AWORPT_AWO"

(?<=AWORPT_AWO)\w{3}

If you need to, we can assert that the three characters we grab are in fact numbers:

(?<=AWORPT_AWO)\d{3}

There are lots of ways to do it. If you need any additional guidance, feel free to ask.

0 0
replied on October 4, 2018

That worked great! 

 

Thanks so much for the help.

0 0
replied on October 4, 2018

Here's a link to the documentation on regular expressions for your reference.

1 0
replied on October 4, 2018

Thank you.

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.