I can't seem to get the right combination of string functions to get this done.
If anybody could point me in the right direction I would be grateful.
given a column containing values like:
abcd-x-100-a;:
abdc-y-101-a;:
abcd-z-102-c;:
abcd-zbc;:
abcd-x-101-a;:
abcd-x-102-a;:
abcd-y-201-c;:
abcd-opelha;:
abcd-prrp;:
abcd-g-222-e;:
bbcda-abc;:
bbcda-abd;:
bbdda-bbb;:
How can I select the substring of the value that lies between the first two '-', or between the first '-' and the end of the value, IF there is only one '-'?
The location of the '-' is not consistent, some values have two '-' some have three '-' and some values have only one '-'.
The result i need from the list above would be:
x
y
z
zbc
x
x
y
opelha
prrp
g
abc
abd
bbb
The fact that there is no consistency in number and location of the '-' is throwing me off.
If anybody could point me in the right direction I would be grateful.
given a column containing values like:
abcd-x-100-a;:
abdc-y-101-a;:
abcd-z-102-c;:
abcd-zbc;:
abcd-x-101-a;:
abcd-x-102-a;:
abcd-y-201-c;:
abcd-opelha;:
abcd-prrp;:
abcd-g-222-e;:
bbcda-abc;:
bbcda-abd;:
bbdda-bbb;:
How can I select the substring of the value that lies between the first two '-', or between the first '-' and the end of the value, IF there is only one '-'?
The location of the '-' is not consistent, some values have two '-' some have three '-' and some values have only one '-'.
The result i need from the list above would be:
x
y
z
zbc
x
x
y
opelha
prrp
g
abc
abd
bbb
The fact that there is no consistency in number and location of the '-' is throwing me off.