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
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
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.
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.
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.
That worked great!
Thanks so much for the help.
Here's a link to the documentation on regular expressions for your reference.
Thank you.