Hi all,
I need to parse a long string that has some fixed and variable characters.
For the fixed characters, I use (\w{#}), but for the variable characters I am looking for a solution.
For example, all the characters in the following string are fixed, except for the red characters, which can vary from 1-24 characters (including white spaces).
XXXX XXX X X X XXXXXXXXXXXXXXXXXXXXXXXX XX XX XX XXXXXXXX XXXXXXXX XXXXXX
Would appreciate any assistance!
If the black characters are always consistent, and assuming the leading there are 8 leading characters and 16 trailing characters something along these lines should work
Right(Left([Code],Length([Code]) - 16),Length([Code]) - 24)
Here is a breakdown of the steps :)
Length([Field]) - 16
this will give you the length of the red characters and the leading characters
Left([Field], Length([Field]) - 16)
adding that to left will return the leading and the red characters
Right([Field], Left(Length([Field]) - 16), Length([Field]) - 24)
stacking that with a right, will just bring out the red characters
@DanAAC Can you provide a sample data?
Thank you!
I am not sure this is what I am looking for. I am going to parse the ENTIRE string, not just the string in red. But the string in red is not fixed.
I am using RegEx to parse the string into columns.
Please see attached. It's essentially the same as in my original post. But I am using RegEx to parse one column that contains a string into multiple columns. The only problem is that the part in red is not fixed.
User | Count |
---|---|
106 | |
85 | |
76 | |
54 | |
40 |